- fixed nocache variable inside if condition of {if} tag

This commit is contained in:
Uwe.Tews
2009-10-21 18:26:14 +00:00
parent 530c4bf108
commit 60d1a30791
8 changed files with 288 additions and 282 deletions

View File

@@ -26,16 +26,16 @@ class Smarty_Internal_Compile_ElseIf extends Smarty_Internal_CompileBase {
// check and get attributes
$_attr = $this->_get_attributes($args);
$nesting = $this->_close_tag(array('if', 'elseif'));
list($nesting, $compiler->tag_nocache) = $this->_close_tag(array('if', 'elseif'));
if (empty($this->compiler->prefix_code)) {
$this->_open_tag('elseif', $nesting);
$this->_open_tag('elseif', array($nesting, $compiler->tag_nocache));
return '<?php }elseif(' . $args['if condition'] . '){?>';
} else {
$tmp = '';
foreach ($this->compiler->prefix_code as $code) $tmp .= $code;
$this->compiler->prefix_code = array();
$this->_open_tag('elseif', $nesting + 1);
$this->_open_tag('elseif', array($nesting + 1, $compiler->tag_nocache));
return '<?php }else{?>' . $tmp . '<?php if (' . $args['if condition'] . '){?>';
}
}