Re: different template paths

From: Date: Thu, 19 Jul 2001 17:51:52 +0000
Subject: Re: different template paths
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1216@lists.php.net to get a copy of this message
That would be nice anyway, but is already implementable by just creating a resource function. All your template_files would be named 'path:template.tpl' or something, and the resource function would just find the template.tpl file in several dirs. A search path is nicer of course. My 'problem' is not solved by this however, because the searchpath itself would be dynamic. If I would have two different 'skins' of the same functionality (e.g. 'red' and 'blue') and the skin is known as a variable $skin, you would have different searchpaths: './templates/default:./templates/red' or './templates/default:./templates/blue'. But you would want to put something about this skin in the template resource to ensure both get compiled and used appropriately. For templates loaded via display() this is easy, you just find the correct template file via some magic and feed it to display. But I would like to say {include file="template2.tpl"} in some template and then have some magic find the file in some dynamic path. Is this too esoteric? Greetz, Ralphm On Thu, Jul 19, 2001 at 10:39:30AM -0500, Monte Ohrt wrote: > An idea... how about supporting a search path in the $template_dir > variable: > > $template_dir = "./templates:./template2:/some/other/dir"; > > or > > $template_dir = array( > "r1" => "./templates:./template2:/default/dir", > "r2" => "./templates:./template3:/default/dir", > "r3" => "./templates:./template4:/default/dir" > ) > > This is a significant change though, because now the parser must check > for the existance of the template before displaying it, and check each > path sequentially. I'm not sure how this would affect other things. And, > would we want to support this in $config_dir and maybe other places? >

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