如何使用smarty模板prestashop模块管理部分
问题描述:
我想要构建一个模块,我们希望使用smarty构建表单和表格。如何使用smarty模板prestashop模块管理部分
在像 /modules/my_module/views/templates/front/my_module.tpl
的Prestashop模块控制器载荷模板文件其中,管理将是/modules/my_module/views/templates/admin/admin_module.tpl
我的观点是我如何显示这个admin_module.tpl在prestashop模块配置页面。
答
你可以找到所有的文档有关在这里创建的Prestashop模块:http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module#CreatingaPrestaShopmodule-UsingSmarty
问候
答
这是很容易。您只需创建views/templates/admin/foo.tpl
,然后仅在getContent()
方法中显示您的模板:
public function getContent()
{
return $this->display(__FILE__, 'views/templates/admin/foo.tpl');
}