mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-05 12:14:12 +02:00
- added $smarty->_tag_stack for tracing block tag hierarchy
This commit is contained in:
@@ -45,9 +45,9 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi
|
||||
$this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
|
||||
// compile code
|
||||
if (is_array($function)) {
|
||||
$output = '<?php $_block_repeat=true; call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),(array(' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl));while ($_block_repeat) { ob_start();?>';
|
||||
$output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func_array(array('{$function[0]}','{$function[1]}'),(array({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl));while (\$_block_repeat) { ob_start();?>";
|
||||
} else {
|
||||
$output = '<?php $_block_repeat=true; ' . $function . '(' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl);while ($_block_repeat) { ob_start();?>';
|
||||
$output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>";
|
||||
}
|
||||
} else {
|
||||
// must endblock be nocache?
|
||||
@@ -60,10 +60,9 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi
|
||||
$this->compiler->has_output = true;
|
||||
// compile code
|
||||
if (is_array($function)) {
|
||||
var_dump('error');
|
||||
$output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),(array(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl)); }?>';
|
||||
$output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo call_user_func_array(array('{$function[0]}','{$function[1]}'),(array({$_params}, \$_block_content, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl)); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
|
||||
} else {
|
||||
$output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo ' . $function . '(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl); }?>';
|
||||
$output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false; echo {$function}({$_params}, \$_block_content, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
|
||||
}
|
||||
}
|
||||
return $output."\n";
|
||||
|
||||
Reference in New Issue
Block a user