Feature #68717
closedTypoScript: Add general PHP function call to stdWrap
0%
Description
TypoScript examples
Simple:
http://php.net/manual/en/function.ucwords.php
page.10 = TEXT page.10.value = hello world page.10.phpFunction = ucwords
More parameters:
http://php.net/manual/en/function.sprintf.php
page.10 = TEXT page.10.value = There are %d monkeys in the %s page.10.phpFunction = sprintf page.10.phpFunction.parameters.1 = 5 page.10.phpFunction.parameters.2 = tree
The parameters are of type string/stdWrap.
This means by default the incoming content is parameter 0. This is the same as:
page.10 = TEXT page.10.phpFunction = sprintf page.10.phpFunction.parameters.0 = There are %d monkeys in the %s page.10.phpFunction.parameters.1 = 5 page.10.phpFunction.parameters.2 = tree
How do we access the incoming content in parameter 2?
http://php.net/manual/en/function.str-replace.php
page.10 = TEXT page.10.value = page.10.phpFunction = str_replace page.10.phpFunction.parameters.0 = %body% page.10.phpFunction.parameters.1 = black page.10.phpFunction.parameters.2 ???
If possible by the stdWrap of the parameter. Any suggestions?
Details:
The return parameter is always casted to string for the beginning, even if array or object. Future versions may offer a more skilled treatment of the return parameter by a property named return
.
Personal motivation:
I want to learn the contribution workflow.
Updated by Elmar Hinz over 9 years ago
The last example should be like this, but I don't find a way to modify it myself.
page.10 = TEXT page.10.value = There are %d monkeys in the %s page.10.phpFunction.parameters.0 = %body% page.10.phpFunction.parameters.1 = black page.10.phpFunction.parameters.2 ???
Please coach me with my first gerrit walkthrough.
Updated by Wouter Wolters over 9 years ago
Please discuss this first in the #typo3-cms-coredev channel on Slack (https://forger.typo3.org/slack) if this gets an go.
If accepted they can also help you getting started with the contribution workflow.
Thanks.
Updated by Elmar Hinz over 9 years ago
Summary of discussion on #typo3-cms-coredev: Useful, but risky to give TypoScript developers direct access to PHP.
Bottom line: TypoScript developers are still second class citizens today with limited responsibility. :->
Can be closed.
Updated by Susanne Moog over 9 years ago
- Status changed from New to Closed
Closed in light of comment #3