Compiler Code cleanup - new syntax features

From: Date: Wed, 18 Dec 2002 17:05:44 +0000
Subject: Compiler Code cleanup - new syntax features
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-439@lists.php.net to get a copy of this message
Committed to CVS, I've vastly cleaned up the compiler code, namely the regular expression work. It is now assembled in the constructor, and each piece is documented. There are also some new syntax available. These are all valid: modifiers for static vals: {"static val"} {"static val"|upper} this also works for parameters: {myfunc p1="boo"|upper} objects can have multiple parameters: {$foo->bar($foo, "bar", _MY_CONST) Constants are allowed. Be careful of constants named the same as PHP functions, the function will get executed if it doesn't require parameters! If security is enabled, constants are not allowed unless you specifically set $security_settings['ALLOW_CONSTANTS']. And, the constant has to be defined. object calls can have modifiers: {$foo->bar()|default:"none"} You can pass modifiers on ANY parameter, even objects: {$foo->bar($foo|default:"none", "my foo"|upper, _BOO|default:"hah")|lower} What is NOT allowed: 1) direct call to constant won't work: {_MY_CONST} 2) objects as parameters (as discussed) won't work: {myfunc foo=$func->bar()} {$myobj->foo($blah->bar())} 3) you cannot put modifiers on modifier parameters (obvious syntax collisions) -- Monte Ohrt <monte@ispi.net>

« previous php.smarty.dev (#439) next »