Hi all.
I'm trying to write a layout script for using with Zend_Log_Writer_Mail
class. I don't figure it out how to access the logged events in the layout
script.
I read some code from the class but I can't find any solution to my problem.
>From the code I saw that the events are assigned to the layout with this
code and then the html body of the email is filled with a call to the render
method
if ($this->_layout) {
// Set the required "messages" value for the layout. Here we
// are assuming that the layout is for use with HTML.
$this->_layout->events =
implode('', $this->_layoutEventsToMail);
// If an exception occurs during rendering, convert it to a
notice
// so we can avoid an exception thrown without a stack frame.
try {
$this->_mail->setBodyHtml($this->_layout->render());
} catch (Exception $e) {
trigger_error(
"exception occurred when rendering layout; " .
"unable to set html body for message; " .
"message = {$e->getMessage()}; " .
"code = {$e->getCode()}; " .
"exception class = " . get_class($e),
E_USER_NOTICE);
}
}
I put this line in my layout script
<div id="footer"><?Zend_Debug::dump(get_object_vars($this));?></div>
but it only output this:
array(2) {
["_useViewStream"] => bool(false)
["_useStreamWrapper"] => bool(false)
}
and if I debug $this->events I obtain null.
Any hint?
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/How-to-use-Zend-Log-Writer-Mail-with-Zend-Layout-tp2222111p2222111.html
Sent from the Zend Framework mailing list archive at Nabble.com.