php:

This expression evaluates what follows as a regular PHP expression except that ' ->' is replaced by dots ' .' and variable names are prefixed with a dollar ' $' sign.

A dot ' .' separated from the rest of expression by spaces is assumed to be a concatenation sign.


            php:htmlentities(foo)
php:'string ${varReplaced}'
php:'string ${some.path().to[0].var}'
php:NOT foo OR (bar GT baz)
php:a + b
php:array('a', 'b', 'c')
php:range(0, 90)
php:foo . a.b.c(e) . htmlentities(SomeClass::staticMethod())
php:SomeClass::ConstOfClass
php:SomeClass::$staticVar

          

php: should be used with care and won't be needed in 80% of your templates but sometimes you will need to invoke some special PHP method to be certain whether a user is logged in, or to retrieve specific complex data depending on some conditions, dynamically inside the template.