Re: [SMARTY-DEV] How to modify the Smartytemplate loding policy

From: Date: Tue, 25 Mar 2003 14:06:29 +0000
Subject: Re: [SMARTY-DEV] How to modify the Smartytemplate loding policy
References: 1 2  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1020@lists.php.net to get a copy of this message
On Tue, Mar 25, 2003 at 10:44:55AM -0300, luis wrote: > Why would I change {include} ? The application will then be hard to > maintain because it's logical to use {include} to do {includes} In some > point {include} must share some code with {fetch} to get a template from > the source. I just want to know where is that intersecting code to > change it and load templates from one dir or another. look in the compiled template what is generated when you have {include} in your template. you'll see that $this->_smarty_include() is called. both, fetch() and _smarty_include() use _get_compile_path() to retrieve the path to the template. this is the intersecting part of them. (you could have figured this out easily, if you had a look at the source) but you won't be happy in overruling _get_compile_path() to search a path of template-directories, since _get_compile_path() is also used to retrieve the compile-path of a template to *write* after compiling. this can have funny effects. you should better override _smarty_include() instead. but i'm sure it will be a significant performance-hit to your compiled templates (if no caching is in use). > -----Original Message----- > From: Jimmy Harlindong [mailto:jimmy@harlindong.com] > Sent: Tuesday, March 25, 2003 10:13 AM > To: Smarty-Dev > Subject: Re: [SMARTY-DEV] How to modify the Smartytemplate loding policy > > How about using a custom function? > > {insert} > > or define a custom tag. > > ----- Original Message ----- > From: "luis" <luis@fuegolabs.com> > To: "'luis'" <luis@fuegolabs.com>; "'Jason > Sweat'" > <sweatjejm@mchsi.com>; <aztek@box.sk> > Cc: "'Smarty Dev'" <smarty-dev@lists.php.net> > Sent: Tuesday, March 25, 2003 10:19 PM > Subject: [SMARTY-DEV] How to modify the Smartytemplate loding policy > > > > Well, I can answer myself, no. > > If I have > > display('foo.tpl'); > > and foo.tpl {includes file='header.tpl'} > > I need to look BOTH for foo.tpl and header.tpl in templates/$user and > if > > they are not found there in templates/ > > If I redefine fetch then foo.tpl can be checked but fetch is not > called > > for the included header.tpl template. > > Ideas? > > > > -- > Smarty Development Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > Smarty Development Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- E-Commerce: Verkauft etwas, das mit elektrischem Strom funktioniert. (modern für Multimedia) Andreas Krennmair

« previous php.smarty.dev (#1020) next »