X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=smarty%2FSmarty-2.6.10%2Flibs%2Fplugins%2Fcompiler.assign.php;fp=smarty%2FSmarty-2.6.10%2Flibs%2Fplugins%2Fcompiler.assign.php;h=2e0201779628ea68db65d965499e5d00e8f6f5df;hb=b42b2bf946332ad8544d53f610be9cb05e80bf56;hp=0000000000000000000000000000000000000000;hpb=e586807dafc64c3fe152ab518599e6cf3f0f84e1;p=mirrors%2FKyberia-bloodline.git diff --git a/smarty/Smarty-2.6.10/libs/plugins/compiler.assign.php b/smarty/Smarty-2.6.10/libs/plugins/compiler.assign.php new file mode 100644 index 0000000..2e02017 --- /dev/null +++ b/smarty/Smarty-2.6.10/libs/plugins/compiler.assign.php @@ -0,0 +1,38 @@ + + * Name: assign
+ * Purpose: assign a value to a template variable + * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign} + * (Smarty online manual) + * @param string containing var-attribute and value-attribute + * @param Smarty_Compiler + */ +function smarty_compiler_assign($tag_attrs, &$compiler) +{ + $_params = $compiler->_parse_attrs($tag_attrs); + + if (!isset($_params['var'])) { + $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING); + return; + } + + if (!isset($_params['value'])) { + $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING); + return; + } + + return "\$this->assign({$_params['var']}, {$_params['value']});"; +} + +/* vim: set expandtab: */ + +?>