I was reading Beginning PHP and MySQL ecommerce. The author asks to download latest smarty version.When book was published it was smarty 2.x now its 3.x. I copied all the files from code download to my folder. The error i got was
Fatal error: Uncaught exception 'SmartyException' with message 'PHP5 requires you to call __construct() instead of Smarty()'
To correct it i changed my code to
<?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::__construct();
// Change the default template directories
$this->template_dir = TEMPLATE_DIR;
$this->compile_dir = COMPILE_DIR;
$this->config_dir = CONFIG_DIR;
}
}
?>
I've follow the following links Fatal error: Uncaught exception 'SmartyException'
Then I got this error:
ERRNO: 2 TEXT: filemtime(): stat failed for C:\xampp\htdocs\tshirtshop/presentation/templates_c\b34e4db7de306d57170626b504196f0c5fe34fa4.file.store_front.tpl.php LOCATION: C:\xampp\htdocs\tshirtshop\libs\smarty\sysplugins\smarty_resource.php, line 772, at August 22, 2014, 9:59 am Showing backtrace: filemtime("C:\xampp\htdocs\tshirtshop/presentation/templates_c\b34e4db7de30...") line 772, file: C:\xampp\htdocs\tshirtshop\libs\smarty\sysplugins\smarty_resource.php Smarty_Template_Source.getCompiled(Object: Smarty_Internal_Template) # line 699, file: C:\xampp\htdocs\tshirtshop\libs\smarty\sysplugins\smarty_internal_template.php Smarty_Internal_Template.__get("compiled") # line 154, file: C:\xampp\htdocs\tshirtshop\libs\smarty\sysplugins\smarty_internal_templatebase.php Smarty_Internal_TemplateBase.fetch("store_front.tpl", null, null, null, true) # line 394, file: C:\xampp\htdocs\tshirtshop\libs\smarty\sysplugins\smarty_internal_templatebase.php Smarty_Internal_TemplateBase.display("store_front.tpl") # line 16, file: C:\xampp\htdocs\tshirtshop\index.php