我正在使用Zend View类创建电子邮件模板,并分配变量。我还使用带有视图脚本文件的助手,但是渲染时会出现错误:
Message: Plugin by name 'EmTpl' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/:/application/modules/customers/views/helpers/
但是,当我使用On Dispatch时,此插件存在,因为在加载控制器的视图脚本时,该插件将加载该助手称为" EMTPL"。
这是我的电子邮件脚本:
$html = new Zend_View();
$html->setScriptPath(APPLICATION_PATH . '/modules/admin/views/scripts/emails/');
//$html->addHelperPath('Zend/View/Helper/','Zend_View_Helper_');
$html->addHelperPath(
APPLICATION_PATH . '/modules/customers/views/helpers/','Zend_View_Helper_'
);
$html->render("customer-new.phtml");
以及我的客户 - new.phtml,
特里斯:
<body>
hello, <?=$this->name?>
<?=$this->emTpl?>
</body>
在控制器查看脚本中调用时,此插件正常工作...但是我希望它可以与我的电子邮件模板脚本一起使用。
谢谢
您必须在设置脚本路径之前添加辅助路径...