mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
- fixed repeat at block plugins
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
06/03/2009
|
||||
- fixed repeat at block plugins
|
||||
|
||||
05/25/2009
|
||||
- fixed problem with caching of compiler plugins
|
||||
|
||||
|
@@ -41,14 +41,14 @@ class Smarty_Internal_Compile_Block_Plugin extends Smarty_Internal_CompileBase {
|
||||
$this->_open_tag($tag, $_params);
|
||||
|
||||
// compile code
|
||||
$output = '<?php $_block_repeat=true;$_smarty_tpl->smarty->plugin_handler->' . $tag . '(array(' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl),\'block\');while ($_block_repeat) { ob_start();?>';
|
||||
$output = '<?php $_block_repeat=true;$_smarty_tpl->smarty->plugin_handler->loadSmartyPlugin(\''.$tag.'\', \'block\'); $_smarty_tpl->smarty->registered_plugins[\'' . $tag . '\'][1](' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl);while ($_block_repeat) { ob_start();?>';
|
||||
} else {
|
||||
// closing tag of block plugin
|
||||
$_params = $this->_close_tag(substr($tag,0,-5));
|
||||
// This tag does create output
|
||||
$this->compiler->has_output = true;
|
||||
// compile code
|
||||
$output = '<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->plugin_handler->' . substr($tag,0,-5) . '(array(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl),\'block\'); }?>';
|
||||
$output = '<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins[\'' . substr($tag,0,-5) . '\'][1](' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl); }?>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ class Smarty_Internal_Plugin_Handler extends Smarty_Internal_Base {
|
||||
public function __call($name, $args)
|
||||
{
|
||||
if ($this->loadSmartyPlugin($name, $args[1])) {
|
||||
// call plugin
|
||||
// call plugin
|
||||
return call_user_func_array($this->smarty->registered_plugins[$name][1], $args[0]);
|
||||
} else {
|
||||
// plugin not found
|
||||
|
Reference in New Issue
Block a user