Re: [SMARTY] extending Smarty
| From: | Ivo Jansch | Date: | Thu, 05 Sep 2002 11:51:32 +0000 |
| Subject: | Re: [SMARTY] extending Smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5937@lists.php.net to get a copy of this message | ||
Hi,
Mattia wrote:
class MySmarty extends Smarty { var $left_delimiter = $ld; var $right_delimiter = $rd; var $compile_check = true; }This is indeed not valid php. You can do it like this: class MySmarty extends Smarty { var $left_delimiter = ""; /** * Constructor function */ function MySmarty() {
global $ld;
$this->Smarty(); // call baseclass constructor
$this->left_delimiter = $ld;
}
}
But if you have the delimiter in global variables, why bother with a derived MySmarty class? You might also do:
$smarty = new Smarty();
$smarty->left_delimiter = $ld;
Greetings,
Ivo
--
Ivo Jansch <ivo@ibuildings.nl>
ibuildings.nl BV - information technology
http://www.ibuildings.nl