RE: [SMARTY] Refactoring templates folder

From: Date: Fri, 27 Oct 2006 17:28:38 +0000
Subject: RE: [SMARTY] Refactoring templates folder
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13538@lists.php.net to get a copy of this message
I didn't even know about the array of paths! Cool. > -----Original Message----- > From: boots [mailto:jayboots@yahoo.com] > Sent: Friday, October 27, 2006 10:20 AM > To: smarty-general@lists.php.net > Subject: Re: [SMARTY] Refactoring templates folder > > Although unsupported, you can make the templates_dir an array > of paths. It is searched in order. So put the common > templates (eg: templates/shared) first in the array. Another > idea: use a custom resource (eg: shared:foo/bar.tpl) -- it > means you have to rewrite your templates -- but only once. > You can then simply modify your resource to retarget the > template locations. > > xo boots > > Eric Mueller wrote: > > Hi, I have so many files in my templates/ folder that I'm > trying to break it > > down into sub-folders. > > > > I can set the templates directory by changing the > $smarty->template_dir > > variable, but the problem is my templates all {include} common files > > (header.tpl, footer.tpl, that sort of thing). > > > > Sooo... is there a way to set the template_dir in the > template itself, so I > > can be sure the common files are loaded from > templates/shared, but then the > > main template comes in from a different sub-folder under > templates/ ? > > > > thanks, > > Eric > > > --------------------------------- > How low will we go? Check out Yahoo! Messenger's low > PC-to-Phone call rates. >

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