Re: [SMARTY] Smarty 2.6.0 RC1 - Change in path handling
| From: | atu | Date: | Wed, 13 Aug 2003 13:07:07 +0000 |
| Subject: | Re: [SMARTY] Smarty 2.6.0 RC1 - Change in path handling | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10055@lists.php.net to get a copy of this message | ||
Hi,
Of course this is a way to handle things. If it give sense depend on your
application structure. If Smarty support an array of multiple template
directories, as you wrote, it should also work correctly. Otherwise I have
some doubts to implement such a feature because it will slow down
applications a little bit. Even in the case of your application there is an
other way to come to the same result.
Armand
----- Original Message -----
From: "Mark Rogers" <mark@quarella.co.uk>
To: <smarty-general@lists.php.net>
Sent: Wednesday, August 13, 2003 1:10 PM
Subject: Re: [SMARTY] Smarty 2.6.0 RC1 - Change in path handling
> > > Granted there are other options, but the array approach is
> > > the most elegant (imho)
> >
> > "Most elegant" is a point of view.
>
> Agreed (I even said as much :-)
>
> > In the array way, if you
> > have some templates "index.tpl" in more than one directory,
> > smarty takes the first it can find. If multiple template
> > directories were defined as different strings you can
> > point smarty to the template you want, even if this
> > template name occure in more than one directory.
>
> This is fine if you want to alternate between different directories
> depending on circumstances (and wouldn't be affected by the suggested code
> change).
>
> What it isn't so good at is handling paths the way an operating system
> does - effecively in order of preference. Yes, use the 404.tpl for this
> virtual host if it has one, but if not use the default 404.tpl. Yes,
render
> the array of data from the database in the specific way desired by the
site
> designer, but until he's had chance to design it use this default template
> which works but isn't pretty.
>
> Imagine a Smarty-based application (eg a shopping cart) which came with a
> complete set of standard templates but always looked in your custom
> directory first; a default install would work, a customised install would
> work, and if you upgrade to a new version of the shopping cart it wouldn't
> matter whether the default templates had changed, your own would still
> override them. (Want to go back to the defaults? Just take your custom
> directory out of the search path.)
>
> It makes it a lot easier to write standardised but customisable
Smarty-based
> applications, which is what I'm trying to do.
>
> Mark Rogers,
> More Solutions Ltd
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>