Re: [SMARTY] Re: Compile time
| From: | messju mohr | Date: | Thu, 20 Feb 2003 23:17:32 +0000 |
| Subject: | Re: [SMARTY] Re: Compile time | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8066@lists.php.net to get a copy of this message | ||
On Thu, Feb 20, 2003 at 11:39:10PM +0100, Tom Sommer wrote:
> Ok ok, I've done all research now...
>
> When you have
>
> function myCompilerFunction($arg, &$smarty)
> {
> $smarty->assign('this','that');
> }
> and do a
> register_compiler_function('runCompileFunction','myCompilerFunction');
>
> you _HAVE_ to insert {runCompileFunction} inside the template... which is
> plain stupid... there has to be some way to make an overall general compile
> function... but ofcause I can add {runCompileFunction} to my template, it
> just doesn't seem that bloody clever and pretty useless
the intention of a compiler-function is to emit php-code into the compiled
template. i don't think it is so pretty useless to be able to tell
*where* in the template the return-value of the compiler-function
should be inserted. :)
maybe you can write a pre-filter that prepends the {runCompileFunction}
in front of every template before it gets compiled?
have fun
messju