2012-10-24 42 views
0

我使用了Zend视图类,并分配变量创建电子邮件模板.. 我也是用的帮手withing视图文件,但它有渲染时的错误: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"); 

和我的客户new.phtml内,

孤单:

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

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

感谢

回答

0

你有设置脚本路径前添加助手路径...