- 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:
Uwe.Tews
2009-04-28 15:37:13 +00:00
parent c724b720be
commit 4c794a3d70
8 changed files with 752 additions and 725 deletions

View File

@@ -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'] . ') { ?>';
}
}
}