php, smarty, extends -> __construct

In general, I wrap smarts in my class:

class EEE extends Smarty {
    private $templ;
    public function __construct($templ) {
        $this->template_dir = ENGINE.'/templ/';
        $this->compile_dir  = ENGINE.'/compile_templ/';
        $this->config_dir   = ENGINE.'/';
        $this->cache_dir    = ENGINE.'/cache_templ/';
        $this->caching = true;
        $this->templ = $templ;
    public function view() {

An error occurs:

Fatal error: Uncaught exception 'SmartyException' with message 'PHP5 requires you to call __construct() instead of Smarty()'...

How to correctly build a class so that it can be called like this:

$template = new EEE(ENGINE. '/templ/');

Answer 1, authority 100%

I didn’t have anything to do with smart, but maybe something like this:





Answer 2, authority 100%

yeah, too, crap was like that!
cerebellum I understand that judging by what the error writes:

PHP5 requires you to call
__construct() instead of Smarty()

need instead:




and when I began to think not only with my cerebellum, I poked around the Smarty code and realized what I needed


by the way, a question: I would immediately post a function for passing smart variables and deploying it =) I think it would be useful for beginners like me =).