So nobody knows anything ? never used it ?

agatone wrote:
> 
> Hi,
> 
> I'm trying to use contextSwitch (or AjaxSwitch) as i want for some action
> to be accessible in JSON format.
> 
> The code i have in my init() of a controller is:
>   $context = $this->_helper->getHelper('ContextSwitch');
>   $context->addActionContext('read', 'json');
>   $context->initContext();
> 
> If my complete runtime invokes only one action (no actionStack used) and
> if I don't call $this->render()  (to render some other script) it works
> just as it should. View is off, layout is off, only view in JSON  fromat
> is sent.
> 
> However this stops working when:
> - your action works in a way that it chooses what view script you will
> render for your action accessed in "norma"l way - it requires
> nameOfViewScript.json.phtml
> 
> - when you're calling more actions in one runtime (use of actionStack for
> example) - it stops because it didn't find sidebar.json.phtml
> 
> 
> I think that when you use context for JSON reply it should clear ALL
> attempts of rendering views (unless you define it otherwise) .
> 
> Maybe I don't see this right and i didn't choose the right way, maybe it
> isn't a "bug", maybe it's wanted feature ;). I don't know but I'd like to
> have this working without need to create *.json.phtml for quite many
> views.
> 
> What you think?
> 
> 
> 

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

Reply via email to