0

我正在使用 zend 视图类创建电子邮件模板,并分配变量.. 我也在使用视图脚本文件的帮助程序,但它在呈现时出现错误:

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");

在我的 customer-new.phtml 中,

有:

<body>
hello, <?=$this->name?>
<?=$this->emTpl?>
</body>

这个插件在控制器视图脚本中调用时工作正常......但我希望它与我的电子邮件模板脚本一起工作。

谢谢

4

1 回答 1

0

在设置脚本路径之前,您必须添加辅助路径...

于 2012-10-24T12:25:39.870 回答