Re: compilerblock plugins patch
| From: | Andr� Rabold | Date: | Mon, 02 Dec 2002 12:43:48 +0000 |
| Subject: | Re: compilerblock plugins patch | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-357@lists.php.net to get a copy of this message | ||
I have just looked for something like this! Great :)
Bye,
André
"M Mohr" <messju@lammfellpuschen.de> schrieb im Newsbeitrag
news:20021202114710.GF14478@pharao.lammfellpuschen.de...
> hello,
>
> i patched smarty to support block-function at compile time. the
> compilerblock-function is searched as compilerblock.[name].php in the
> plugins_dirs and has precedence before simple (==old)
> compiler-funcions.
>
> alternatively you can register compilerblock-functions using
> $smarty->register_compilerblock_function(..).
>
> the function has to be declared as:
>
> function func($tag_args, $start_tag, &$smarty) ...
>
> or
>
> function smarty_compilerblock_csv($tag_args, $start_tag, &$smarty) ...
>
> where tag_args ar the (unparsed) arguments, like in the simple
> compiler-functions and $start_tag is a boolean indicating wether the
> function was called at the beginning or the end of the block.
>
> i attached the diff against the lates cvs-version. it's not small, but
> pretty simple, since it is a mainly a rip-off of
> Smarty_Compiler::_compile_block_tag()
>
> i would love to see it applied in Smarty-2.3.2 and i am willing to
> provide documentation for such plugins and to maintain this patch if
> necessary.
>
> any use for it?
> any comments?
>
> regards
> messju mohr
>