9 function compile_include($arguments, &$object)
11 $_args = $object->_parse_arguments($arguments);
14 if (empty($_args['file']))
16 throw new Template_Exception("missing 'file' attribute in include tag", $object);
19 foreach ($_args as $arg_name => $arg_value)
21 if ($arg_name == 'file')
23 $include_file = $arg_value;
26 else if ($arg_name == 'assign')
28 $assign_var = $arg_value;
31 if (is_bool($arg_value))
33 $arg_value = $arg_value ?
'true' : 'false';
35 $arg_list[] = "'$arg_name' => $arg_value";
38 if (isset($assign_var))
40 $output = '<?php $_templatelite_tpl_vars = $this->_vars;' .
41 "\n\$this->assign(" . $assign_var . ", \$this->_fetch_compile_include(" . $include_file . ", array(".implode(',', (array)$arg_list).")));\n" .
42 "\$this->_vars = \$_templatelite_tpl_vars;\n" .
43 "unset(\$_templatelite_tpl_vars);\n" .
48 $output = '<?php $_templatelite_tpl_vars = $this->_vars;' .
49 "\necho \$this->_fetch_compile_include(" . $include_file . ", array(".implode(',', (array)$arg_list)."));\n" .
50 "\$this->_vars = \$_templatelite_tpl_vars;\n" .
51 "unset(\$_templatelite_tpl_vars);\n" .