我正在使用 Prestashop 1.7.6.4。我想在钩子中呈现一个模板。我正在通过以下代码执行此操作:
class MyModuleName extends PaymentModule
{
public function hookActionValidateOrder($params)
{
/**
* Verify if this module is enabled
*/
if (!$this->active) {
return;
}
if (Configuration::get('inline')) {
$this->context->smarty->assign([
'module' => $order->module
]);
return $this->display(__FILE__,
'views/templates/hook/displayStatusOrder.tpl');
}
// more code goes here
}
}
请注意,我也尝试过
return $this->fetch('module:myModule/views/templates/hook/displayStatusOrder.tpl');
结果是一样的。
但是我收到以下错误:
(1/1) SmartyException
0():Missing '$template' parameter
我绝对确定我的模板存在。它有正确的名字。
我的文件夹结构是这样的:
myModuleName
views
templates
hook
displayStatusOrder.tpl
我试过删除缓存,重新安装模块等等。
我显然遗漏了一些明显的东西。
largeQ
繁星点点滴滴
随时随地看视频慕课网APP