38 public function compile($args, $compiler, $parameter, $tag, $method)
40 if (!isset($tag[5]) || substr($tag, -5) !=
'close') {
44 if ($_attr[
'nocache'] ===
true) {
45 $compiler->tag_nocache =
true;
47 unset($_attr[
'nocache']);
49 $_paramsArray = array();
50 foreach ($_attr as $_key => $_value) {
52 $_paramsArray[] =
"$_key=>$_value";
54 $_paramsArray[] =
"'$_key'=>$_value";
57 $_params =
'array(' . implode(
",", $_paramsArray) .
')';
59 $this->
openTag($compiler, $tag .
'->' . $method, array($_params, $compiler->nocache));
61 $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
63 $output =
"<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}->{$method}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
65 $base_tag = substr($tag, 0, -5);
67 if ($compiler->nocache) {
68 $compiler->tag_nocache =
true;
71 list($_params, $compiler->nocache) = $this->
closeTag($compiler, $base_tag .
'->' . $method);
73 $compiler->has_output =
true;
75 if (!isset($parameter[
'modifier_list'])) {
76 $mod_pre = $mod_post =
'';
78 $mod_pre =
' ob_start(); ';
79 $mod_post =
'echo ' . $compiler->compileTag(
'private_modifier', array(), array(
'modifierlist' => $parameter[
'modifier_list'],
'value' =>
'ob_get_clean()')) .
';';
81 $output =
"<?php \$_block_content = ob_get_contents(); ob_end_clean(); \$_block_repeat=false;" . $mod_pre .
" echo \$_smarty_tpl->smarty->registered_objects['{$base_tag}'][0]->{$method}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . $mod_post .
" } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
openTag($compiler, $openTag, $data=null)
Push opening tag name on stack.
getAttributes($compiler, $attributes)
This function checks if the attributes passed are valid.
compile($args, $compiler, $parameter, $tag, $method)
Compiles code for the execution of block plugin.
closeTag($compiler, $expectedTag)
Pop closing tag.