Re: [SMARTY] Too many includes

From: Date: Thu, 03 Jul 2003 20:56:13 +0000
Subject: Re: [SMARTY] Too many includes
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9831@lists.php.net to get a copy of this message
On Thu, Jul 03, 2003 at 08:09:35PM +0200, Dorthe Luebbert wrote: > Hi, > > for several reasons I had to build a template which contains lots of > other templates (up to 100) . I cannot change this easily, maybe I > cannot change this at all. Those are "nested templates", about 4-5 > different templates which repeat, see > http://www.3uu.de/nestedtemplates.jpg. > > It takes a lot of time for Smarty to __include__ all the templates, do > you have any idea how to improve the performance? (Beside throwing away > our templates). hmm, not easy. - you can try to employ a source-code cache like phpa ( http://www.php-accelerator.co.uk/ ). smarty benefits vastly by it in general and i think includes especially. - you can write a prefilter the resolves the includes at compile-time before the template is passed to the compiler. some preg_replace-magic should do it. if you have dynamic includes ('{include file=$var}' instead of '{include file="const.tpl"}' you may have to restruct your templates a little, since $var is not known at compile-time and cannot be resolved in a prefilter. - there has been some discussion at the forum about an issue like yours: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=291 maybe one of the solutions offered over there is an option for you greetings messju > Thanx > > Dorthe

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