9 * Smarty {assign} compiler function plugin
11 * Type: compiler function<br>
13 * Purpose: assign a value to a template variable
14 * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign}
15 * (Smarty online manual)
16 * @param string containing var-attribute and value-attribute
17 * @param Smarty_Compiler
19 function smarty_compiler_assign($tag_attrs, &$compiler)
21 $_params = $compiler->_parse_attrs($tag_attrs);
23 if (!isset($_params['var'])) {
24 $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING
);
28 if (!isset($_params['value'])) {
29 $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING
);
33 return "\$this->assign({$_params['var']}, {$_params['value']});";
36 /* vim: set expandtab: */