A new version of extension expressions (1.1.0) was released to the TER today. The main new feature is the addition of functions which can be called on any expression. The syntax is as follows:
The functions are keys which are recognized by the expression parser and correspond to existing PHP or TYPO3 functions. Custom functions can be added via a hook. An example might be:
This will retrieve variable "foo" from the GET/POST vars and put it through t3lib_db::fullQuoteStr() with the value of variable "foo" as a first argument and "pages" as the second one. Assuming variable "foo" contained the string "bar", the result will be:
New expression key¶
Fabien introduced the new expression key "plugin". This is a shortcut to $GLOBALS['TSFE']->tmpl->setup['plugin.'] which makes it easy to retrieve a value from the TS configuration of a given plugin.
A number of other bugs were fixed, in particular the handling of subexpressions, which was broken. Some features were also missing from the manual.
In parallel to that, a new extension was created called "expressions_sandbox". It provides a FE plugin to test expressions easily, as it's often not easy to test expressions within the context of an existing extension. The extension will probably not be released to the TER, as it's really useful only to developers, but it can be gotten from Forge: http://forge.typo3.org/projects/show/extension-expressions_sandbox.
Also available in: Atom