How to load controller in template file in Opencart 2.3x version

651 Views Asked by At


I have use opencart 2.3x version for create new theme...
I want to load controller in template file (.tpl).

 <?php
     $load = $this->registry->get('load');
     $html = $load->controller('module/hit_sidebar',$data);
 ?>

But it will give error :

Notice: Undefined property: Template\PHP:registry

How can i solve this...?

1

There are 1 best solutions below

0
On

You can not use registry in template(.tpl) file in opencart 2.3x version.

it work only lower then opencart 2.2x version..