ari*_*man 3 module smarty prestashop
我想构建一个模块,我们喜欢使用smarty构建表单和表.
在prestashop模块控制器加载模板文件,如/modules/my_module/views/templates/front/my_module.tpl
admin将是/modules/my_module/views/templates/admin/admin_module.tpl
我的观点是如何在prestashop模块配置页面中显示此admin_module.tpl.
这真的很容易.您只需创建views/templates/admin/foo.tpl,然后只在getContent()方法中显示您的模板:
public function getContent()
{
return $this->display(__FILE__, 'views/templates/admin/foo.tpl');
}
Run Code Online (Sandbox Code Playgroud)