Re: [SMARTY] 'Default' template directory?
| From: | Gerard Samuel | Date: | Thu, 26 Feb 2004 16:06:05 +0000 |
| Subject: | Re: [SMARTY] 'Default' template directory? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11029@lists.php.net to get a copy of this message | ||
On Thursday 26 February 2004 10:24 am, Andreas Goetz wrote:
> I've developing a component (phpApplet) based on Smarty, it is using a set
> of template files. Based on this component I have several applications
> using it, each requires some simple tweaks of of or the other template
> file.
>
> Now, is it possible to have a second template directory that contains only
> modified versions of the original template files, e.g. have Smarty look
> into the application-specific folder first and into the default template
> folder only if the requried template file is not found there?
>
Maybe you want to look at $smarty->template_exists($tpl)
http://smarty.php.net/manual/en/api.template.exists.php
if ($smarty->template_exists('default_folder_template.tpl'))
{
// Load the default here
}
else
{
// Load the modified versions here
}