Re: [SMARTY] Recursive includes
| From: | messju mohr | Date: | Sat, 22 Mar 2003 09:24:46 +0000 |
| Subject: | Re: [SMARTY] Recursive includes | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8826@lists.php.net to get a copy of this message | ||
On Sat, Mar 22, 2003 at 08:08:21AM -0000, Dana Freer wrote:
>
> Apologies if this has been asked before, but I am new to Smarty, and there
> appears to be no faq...
>
> One of my templates recursively includes itself and passes variables in the
> include. Though this works fine, it seems to be inefficient (according to
> the debug timings) and was wondering if there is a better way of doing this?
> Are the included files automatically cached by Smarty?
>
> eg. --- my.tpl ---
> ...
> ...
> {include file="my.tpl" var1="abc" var2="def"}
> ...
> ...
smarty does not cache the compiled template in memory. you can add
this feature by using a sourcecode-cache to your php like
http://www.php-accelerator.co.uk/.
additionally: most types of recursion can be translated to {section}
or {foreach} calls which is definately faster than reincluding the
template. maybe you problem can also be solved with {section} when you
precompute some stuff in php.