SugarNewsWikiDocsBugsForumFilesSource LoginRegister
HomeForumsSugarmodifiers
modifiers
Sugar
Sean Middleditch Feb 25th, 2009 at 7:29pm
PHP-Sugar trunk now supports modifiers, as found in Smarty or Django. Syntax is the same as you'd expect:

uppercased $value:
{% $value|upper %}

pass uppercased $value as the var parameter to function:
{% function var=$value|upper %}

print the uppercased result of function:
{% function|upper var=$value %}

Modifiers can be chained and can take parameters using the :param syntax, e.g.
{% $value|default:'string'|upper %}

Reply to Topic
or Login