Re: [SMARTY] subclassing smarty problem

From: Date: Thu, 10 Apr 2003 01:57:28 +0000
Subject: Re: [SMARTY] subclassing smarty problem
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9205@lists.php.net to get a copy of this message
From: "olivie hericord" <ohericord@free.fr> > Parse error : parse error, unexpected T_VARIABLE, expecting > T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in > /Users/me/MySites/myproject/code/myapp_setup.php on line 5 > > > line 5 is $this->Smarty(); > > What's going on...i don't undersatnd your code needs to be in a constructor function. In PHP4, that is a function with the same name as the class: class Myapp_Smarty extends Smarty { function Myapp_Smarty() { // call constructor $this->Smarty(); // setup Smarty configs for your app $this->template_dir = './my/path/to/templates'; $this->caching=true; } }

« previous php.smarty.general (#9205) next »