|
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 |
Ashenafi Alemu Smarty n00b
Joined: 25 Jan 2018 Posts: 2
|
Posted: Thu Jan 25, 2018 5:45 am Post subject: Fatal error: Uncaught Error |
|
|
I am new to Smarty and I just used smarty in the code below and the following error message kicked my ass: Fatal error: Uncaught Error: Call to a member function _callExternalMethod() on null in C:\tshirtshop\libs\smarty\sysplugins\smarty_internal_data.php:241 Stack trace: #0 C:\tshirtshop\presentation\application.php(12): Smarty_Internal_Data->__call('Smarty', Array) #1 C:\tshirtshop\index.php(7): Application->__construct() #2 {main} thrown in C:\tshirtshop\libs\smarty\sysplugins\smarty_internal_data.php on line 241
<?php
// Reference Smarty library
require_once SMARTY_DIR . 'Smarty.class.php';
/* Class that extends Smarty, used to process and display Smarty
files */
class Application extends Smarty
{
// Class constructor
public function __construct()
{
// Call Smarty's constructor
parent::Smarty();
// Change the default template directories
$this->template_dir = TEMPLATE_DIR;
$this->compile_dir = COMPILE_DIR;
$this->config_dir = CONFIG_DIR;
}
}
?> |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jan 25, 2018 2:22 pm Post subject: |
|
|
Most likely you did not install Smarty correctly, since the error is thrown from inside the library. |
|
Back to top |
|
Ashenafi Alemu Smarty n00b
Joined: 25 Jan 2018 Posts: 2
|
Posted: Fri Jan 26, 2018 7:39 am Post subject: |
|
|
I got it...smarty installation was not a problem...I just changed parent:Smarty() to parent::__construct(); and it works well |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot 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
|