38 public function compile($args, $compiler, $parameter, $tag, $method)
42 if ($_attr[
'nocache'] ===
true) {
43 $compiler->tag_nocache =
true;
45 unset($_attr[
'nocache']);
47 if (isset($_attr[
'assign'])) {
48 $_assign = $_attr[
'assign'];
49 unset($_attr[
'assign']);
52 if ($compiler->smarty->registered_objects[$tag][2]) {
53 $_paramsArray = array();
54 foreach ($_attr as $_key => $_value) {
56 $_paramsArray[] =
"$_key=>$_value";
58 $_paramsArray[] =
"'$_key'=>$_value";
61 $_params =
'array(' . implode(
",", $_paramsArray) .
')';
62 $return =
"\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\$_smarty_tpl)";
64 $_params = implode(
",", $_attr);
65 $return =
"\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})";
67 if (empty($_assign)) {
69 $compiler->has_output =
true;
70 $output =
"<?php echo {$return};?>\n";
72 $output =
"<?php \$_smarty_tpl->assign({$_assign},{$return});?>\n";
getAttributes($compiler, $attributes)
This function checks if the attributes passed are valid.
compile($args, $compiler, $parameter, $tag, $method)
Compiles code for the execution of function plugin.