adding some strings
[moodle-linuxchix.git] / lib / smarty / plugins / compiler.assign.php
blob2e0201779628ea68db65d965499e5d00e8f6f5df
1 <?php
2 /**
3 * Smarty plugin
4 * @package Smarty
5 * @subpackage plugins
6 */
8 /**
9 * Smarty {assign} compiler function plugin
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
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);
25 return;
28 if (!isset($_params['value'])) {
29 $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING);
30 return;
33 return "\$this->assign({$_params['var']}, {$_params['value']});";
36 /* vim: set expandtab: */