Re: [SMARTY] Recursive includes

From: Date: Sat, 22 Mar 2003 09:32:06 +0000
Subject: Re: [SMARTY] Recursive includes
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-8827@lists.php.net to get a copy of this message
On Sat, Mar 22, 2003 at 10:24:46AM +0100, messju mohr wrote: > 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... http://smarty.php.net/faq.php :) > > 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.

« previous php.smarty.general (#8827) next »