Re: [SMARTY] Multiple Template Directories
| From: | Vincent DEBOUT | Date: | Mon, 22 Aug 2005 10:46:24 +0000 |
| Subject: | Re: [SMARTY] Multiple Template Directories | ||
| References: | 1 2 3 4 5 6 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12982@lists.php.net to get a copy of this message | ||
Hello,
You will find attached a file that I use on my web site. If the user has
defined a template dir, it will be automaticaly used else the default
templates are used.
Instead of using:
require_once( 'Smarty.class.php' );
$smarty = new Smarty();
I use:
require_once( 'smarty_api.php' );
$smarty = new Smarty_custom();
Best regards
Vincent
> On the current site I'm working on I would like the users to be
> able to customize their own section of the site if they wish to by
> providing their own template.
>
> So what I would like is for smarty to search the users directory
> and if no template is found there, load the template from the normal
> template directory. In other words, if the user has provided a
> template, that it override the general one.
>
> After some googling I saw some discussions that talked about
> modifying the smarty code itself to allow an array of template
> directories, seems smarty is smart enough to handle this, however
> this solution doesn't sound very elegant as I'm going to be fighting
> the developers on every update.
>
> What is a good clean way to do this? All suggestions are
> welcome. In my setup I subclass smarty as per the manual if that helps.
>
>
> Vonleigh Simmons
> <http://illusionart.com/>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>