Back to Top

Tpl file loading in Opencart 2.2.0.0

Updated 19 April 2016

In Opencart 2.2.0.0  view file i.e .tpl file loading is different from Opencart 2.1.x.x, So we will learn that how Opencart load view file at front end . Before going to Version 2.2.0.0 just look at the Version 2.1.x.x view file loading ,In 2.1.x.x we usually uses full path of the tpl file in the first parameter of the view function which presents in the loader.php file under library.

view1

view function of loader.php file

view2

But in Version 2.2.0.0  we have to use only the path which starts after template folder to the file as a parameter named “route” of view function which presents inside the loader.php library file

Searching for an experienced
Opencart Company ?
Find out More

view3

And inside the view function a object of template class  to call the render function of basic.php file by making a object of “basic” class through template class to load the view file. And in the render function codes are same as version 2.1.x.x view function code.

view5

Template class constructor

view6

render function of basic class

webkul7

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home