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/
ただし、このプラグインは、「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>
このプラグインは、コントローラー ビュー スクリプトで呼び出すと正常に動作しますが、メール テンプレート スクリプトで動作させたいと考えています。
ありがとう