Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Fatal error: Uncaught Error

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
Ashenafi Alemu
Smarty n00b


Joined: 25 Jan 2018
Posts: 2

PostPosted: Thu Jan 25, 2018 5:45 am    Post subject: Fatal error: Uncaught Error Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1270

PostPosted: Thu Jan 25, 2018 2:22 pm    Post subject: Reply with quote

Most likely you did not install Smarty correctly, since the error is thrown from inside the library.
Back to top
View user's profile Send private message
Ashenafi Alemu
Smarty n00b


Joined: 25 Jan 2018
Posts: 2

PostPosted: Fri Jan 26, 2018 7:39 am    Post subject: Reply with quote

I got it...smarty installation was not a problem...I just changed parent:Smarty() to parent::__construct(); and it works well
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP