[fw-general] Re: How can I inlude flashMessenger messages in JSON context

2011-02-18 Thread Frank DiRocco
On Feb 12, 2011, at 2:45 PM, gelform wrote: $messages = $flashMessenger-getMessages (); if ( $flashMessenger-hasCurrentMessages () ) { $messages = array_merge ( $messages, $flashMessenger-getCurrentMessages ()

[fw-general] Re: How can I inlude flashMessenger messages in JSON context

2011-02-12 Thread gelform
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

[fw-general] Re: How can I inlude flashMessenger messages in JSON context

2011-02-11 Thread gelform
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

Re: [fw-general] Re: How can I inlude flashMessenger messages in JSON context

2011-02-11 Thread Hector Virgen
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

[fw-general] Re: How can I inlude flashMessenger messages in JSON context

2011-02-11 Thread gelform
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

[fw-general] Re: How can I inlude flashMessenger messages in JSON context

2011-02-11 Thread gelform
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:

Re: [fw-general] Re: How can I inlude flashMessenger messages in JSON context

2011-02-11 Thread Hector Virgen
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