On Feb 12, 2011, at 2:45 PM, gelform wrote:
$messages = $flashMessenger-getMessages ();
if ( $flashMessenger-hasCurrentMessages () )
{
$messages = array_merge ( $messages,
$flashMessenger-getCurrentMessages
()
Thanks! That worked to get my layout working again. I cracked the book Pro
Zend Framework Techniques again, and he has it set up like that, too. So it
makes a bit more sense to me.
However, my original issue is still not working. I still don't see my
messages in the JSON response. :-\ Right back
Hector Virgen said:
When using the JSON context with the ContextSwitch helper, all view
variables are returned in the JSON response. So the easiest thing to do is
to provide the FlashMessenger messages to the view.
Add one of these lines in your controller's action method:
// Get messages
On Fri, Feb 11, 2011 at 9:52 AM, gelform co...@gelform.com wrote:
I was able to create a plugin and get the messages, but I'm not sure how to
send them to the view?
I suggest bootstrapping the view (if you're not already) and pulling it
statically from the bootstrap in your controller
Thanks! I'm getting there. View was in fact null, so I added the line to
application.ini to instantiate the view resource. But now my layout script
no longer sees the view resource ($view is NULL in my layout.phtml). If it
helps, the layout script also can no longer find an included partial
I didn't say that right. After adding the line in application.ini, my View
($this in layout.phtml) doesn't have variables I set in my controller, or in
the postDispatch of the Controller plugin.
--
View this message in context:
I believe the correct approach is to assign those to $this-layout(), for
example:
## views/scripts/index/index.phtml
?php $this-layout()-foo = Foo! ?
## layouts/scripts/layout.phtml
?php echo $this-layout()-foo ?
--
*Hector Virgen*
Sr. Web Developer
http://www.virgentech.com