Code

Completed migration
[gosa.git] / include / smarty / plugins / compiler.assign.php
1 <?php
2 /**
3  * Smarty plugin
4  * @package Smarty
5  * @subpackage plugins
6  */
8 /**
9  * Smarty {assign} compiler function plugin
10  *
11  * Type:     compiler function<br>
12  * Name:     assign<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
18  */
19 function smarty_compiler_assign($tag_attrs, &$compiler)
20 {
21     $_params = $compiler->_parse_attrs($tag_attrs);
23     if (!isset($_params['var'])) {
24         $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING);
25         return;
26     }
28     if (!isset($_params['value'])) {
29         $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING);
30         return;
31     }
33     return "\$this->assign({$_params['var']}, {$_params['value']});";
34 }
36 /* vim: set expandtab: */
38 ?>