mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-03 13:51:36 +01:00
- the {function} tag can no longer overwrite standard smarty tags
- inherit functions defined by the {fuction} tag into subtemplates
- added {while <statement>} sytax to while tag
This commit is contained in:
@@ -25,9 +25,14 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase {
|
||||
$this->required_attributes = array('if condition');
|
||||
// check and get attributes
|
||||
$_attr = $this->_get_attributes($args);
|
||||
|
||||
$this->_open_tag('while');
|
||||
return '<?php while (' . $args['if condition'] . ') { ?>';
|
||||
if (is_array($args['if condition'])) {
|
||||
$_output = " <?php if (!isset(\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."])) \$_smarty_tpl->tpl_vars[".$args['if condition']['var']."] = new Smarty_Variable;\n";
|
||||
$_output .= " while (\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."]->value = ".$args['if condition']['value'].") {\n ?>";
|
||||
return $_output;
|
||||
} else {
|
||||
return '<?php while (' . $args['if condition'] . ') { ?>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user