![Smarty Forum Index Smarty Forum Index](templates/smarty/images/phpbb2_logo.gif) |
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Oct 28, 2011 2:52 pm Post subject: Call of unknown method 'Smarty' |
|
|
If you see this error:
Quote: | Fatal error: Uncaught exception 'SmartyException' with message "Call of unknown method 'Smarty'" |
This means you need to use PHP5 style constructors, not PHP4.
PHP4 used the class name itself for the constructor. PHP5 uses __construct() as the constructor, and uses parent:__construct() to call the parent constructor.
If you are extending Smarty, your constructor should look like so:
Code: | class MySmarty Extends Smarty {
function __construct() {
parent::__construct();
// custom initialization stuff here
}
} |
Do NOT call $this->Smarty(), in your constructor, as this method no longer exists in the Smarty class. |
|
Back to top |
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|