RE: [SMARTY-DEV] Quick Question
| From: | luis | Date: | Tue, 25 Mar 2003 12:14:37 +0000 |
| Subject: | RE: [SMARTY-DEV] Quick Question | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1016@lists.php.net to get a copy of this message | ||
Will this work with templates {included} in other templates too?
-----Original Message-----
From: Jason Sweat [mailto:sweatjejm@mchsi.com]
Sent: Monday, March 24, 2003 11:23 PM
To: luis; aztek@box.sk
Cc: 'Smarty Dev'
Subject: Re: [SMARTY-DEV] Quick Question
From: "luis" <luis@fuegolabs.com>
> Find and replace is not a nice option because it will force developers
> to remember to write an awful if statement for each display, it's just
> nasty.
>
> How can I do it extending the Smarty class?
Use the code Monte posted earlier:
class my_smarty extends smarty
{
function display($user, $tpl_file, $cache_id = null, $compile_id =
null)
{
if($this->template_exists("$user/$tpl_file")) {
parent::display("$user/$tpl_file")
}else{
parent::display($tpl_file);
}
}
}