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