I know this is kind of old, but if anyone else finds this I hope it saves
them some time.
The "trick" to getting HTML to turn off the Layout is to create a view with
the suffix .ajax.phtml AND call the routine with the format set to html.

So if your view was conditions.phtml, you need to create a
conditions.ajax.phtml and then call
your action controller with the argument format=html

so you could call
/controller/conditions/format/html
or
/controller/conditions?format=html
and then ajax Context switch will behave as you expect.  It will render only
the snippet of html in the /script/controller/conditions.ajax.phtml with no
layout.



Anton Visser-3 wrote:
> 
> I am AJAX context switching setup and working great for json, but when I
> try to get html back, the controller is not disabling the layout.
> 
> In my init() function I have
> 
> $ajaxContext = $this->_helper->getHelper('AjaxContext');
> $ajaxContext->addActionContext('conditions', array('json','html'))
>             ->initContext();
> 
> 
> /conditions/format/json/  works great, I just get the json encoded content
> /conditions/format/html/  sends me the layout wrapped around the
> conditions.ajax.phtml view
> 
> I have manually disabled the layout, if
> $this->_request->isXmlHttpRequest(), but I thought the AjaxContent was
> supposed to do that for me, in html, json and xml contexts. What am I
> missing?
> 
> I am using ZF 1.5.2
> 
> thanks for the help.
> 
> cheers,
> Anton
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ajax-html-context-tp17786774p24954942.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to