如何在opencart 2.0的标头tpl文件中插入模块? [英] How to insert module in header tpl file in opencart 2.0?

查看:105
本文介绍了如何在opencart 2.0的标头tpl文件中插入模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在opencart 2.0的header.tpl文件中插入模块?

How to insert a module in header.tpl file in opencart 2.0 ?

我有一个模块.没有该模块的布局位置选项. 所以我需要手动将其放置在header.tpl文件中.

I have a module. Does not have the layout position option for that module. So i need to place that manually in header.tpl file.

我已经对此进行了尝试,但不适用于opencart 2.0.

I am already tried this but not working for opencart 2.0.

请任何人帮助我.

谢谢

推荐答案

在opencart 2.0或更高版本中,您可以加载模块的控制器:-

In opencart 2.0 or above you can load the contoller of module :-

$data['anyname'] = $this->load->controller('modulefolder/filename');

并且在该模块的控制器文件中,应该返回其呈现的内容.例如:

And In that module's controller file there should be a return of what it render.Like:

return $this->load->view('default/template/modulefolder/filename.tpl', $data);

这篇关于如何在opencart 2.0的标头tpl文件中插入模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆