About 'defun'the template object in index_table.tpl.inc! (Design/Themes)

by micsi, Thursday, April 24, 2008, 13:13 (5839 days ago)
edited by Alfie, Thursday, April 24, 2008, 21:43

In the template file index_table.tpl.inc,any one can help me find the smarty register block 'defun' in the {defun name="tree" list=$tree.$thread level=0}. It's a smarty function register_block() to create dynamic register/defined block fuction plug-in. Ever though I understand about the related theory, nowhere to find the register block function.
I a new buddy in the programming world. Just learn something from analyzing the code about LAMP.
HELP!HELP!!HELP!!!
Administrator, help!
Thank you!!!:-)
[image]

locked
5617 views

'defun' plugin about smarty in detail?

by micsi, Thursday, April 24, 2008, 14:05 (5839 days ago) @ micsi
edited by Alfie, Thursday, April 24, 2008, 21:40

Any one can help me to analyze this function and about plugin about 'defun'!
Thank you all the same!!!:-)

/* create code for closing a function definition and calling said function */
function smarty_compiler_defun_close($tag_args, &$compiler) {
    list($name, $attrs, $open_tag_args, $func_key) = array_pop($compiler->_tag_stack);
    if ($name!='defun') $compiler->_syntax_error("unexpected {/defun}");
    return " $this->_tpl_vars = $_fun_tpl_vars; }} " . $func_key . smarty_compiler_fun($open_tag_args, $compiler);
}
$this->register_compiler_function('/defun', 'smarty_compiler_defun_close');

--
Edit: linked to old thread; syntax highlighting activated. [Alfie]

locked
5715 views

RSS Feed of thread