我想爲我發送的電子郵件使用佈局。我目前使用Zend Layout作爲網頁,但也想主題我的電子郵件。如何在Zend Framework中使用電子郵件的佈局
這是我試過的。
這是我的函數發送電子郵件
$layout = Zend_Layout::getMvcInstance();
$this->_view->render($template);
$html = $layout->render('email');
$this->setBodyHtml($html,$this->getCharset(), $encoding);
$this->send();
電子郵件佈局僅僅是
The email content
<?php echo $this->layout()->content; ?>
當談到因爲通過它只是有一個電子郵件...
The email content
如果您打算需要原始模板來顯示常規MVC輸出,您可以簡單地克隆佈局以不覆蓋內容/佈局/參數,請使用 '$ layout = clone Zend_Layout :: getMvcInstance();' 作爲第一行 – DesertEagle 2013-11-22 08:56:59