/[cvs]/nfo/php/libs/net.php.smarty/plugins/compiler.assign.php
ViewVC logotype

Contents of /nfo/php/libs/net.php.smarty/plugins/compiler.assign.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Wed Jun 16 21:58:16 2004 UTC (20 years ago) by joko
Branch: MAIN
CVS Tags: HEAD
updated to smarty-2.6.3

1 <?php
2
3 /**
4 * Smarty {assign} compiler function plugin
5 *
6 * Type: compiler function<br>
7 * Name: assign<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
13 */
14 function smarty_compiler_assign($tag_attrs, &$compiler)
15 {
16 $_params = $compiler->_parse_attrs($tag_attrs);
17
18 if (!isset($_params['var'])) {
19 $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING);
20 return;
21 }
22
23 if (!isset($_params['value'])) {
24 $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING);
25 return;
26 }
27
28 return "\$this->assign({$_params['var']}, {$_params['value']});";
29 }
30
31 /* vim: set expandtab: */
32
33 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed