My ajax calls always send the format parameters.

Now I see that I have one json action, that is triggered ONLY from
javascript, so no user will type /some/action/format/json in the location
bar of the browser, but still I get

exception 'Zend_View_Exception' with message 'script
'some/action.phtml' not found in path...


Regards,
Saša Stamenković


On Thu, Mar 25, 2010 at 4:09 PM, A.J. Brown <[email protected]> wrote:

> Correction: obviously ajaxContext does use the format parameter.  I'm
> not sure what I was thinking :)
>
>
> On Thu, Mar 25, 2010 at 11:06 AM, A.J. Brown <[email protected]> wrote:
> > Actually, I believe that ajaxContext does not use the "format" request
> > parameter.  Your problem is likely that the client is not sending the
> > proper headers.
> >
> > Your best solution would be to use the contextSwitch helper instead,
> > and change your AJAX calls to pass the format parameter, or to throw
> > an exception when !$this->getRequest()->isXmlHttpRequest() for actions
> > that MUST be called via AJAX.  You might even want to put all of these
> > calls in their own controller, and throw the error to remain DRY.
> >
> >
> > On Thu, Mar 25, 2010 at 2:58 AM, Саша Стаменковић <[email protected]>
> wrote:
> >> I thinks second requirement is there, but XMLHttpRequest is not.
> Otherwise,
> >> it would always fail.
> >>
> >> Regards,
> >> Saša Stamenković
> >>
> >>
> >> On Wed, Mar 24, 2010 at 6:15 PM, Jurian Sluiman <
> [email protected]>
> >> wrote:
> >>>
> >>> On Tuesday 23 Mar 2010 20:15:03 Саша Стаменковић wrote:
> >>> > Interesting. Is there a way to solve it on one place. What is enough
> for
> >>> > me
> >>> > is to prevent logging errors in error controller.
> >>> > So custom exception thrown from controller plugin is fine...if ajax
> >>> > action
> >>> > is called without ajax.
> >>> >
> >>> > Regards,
> >>> > Saša Stamenković
> >>>
> >>> Solving the problem in one place means you need to extend the
> ajaxContext
> >>> action helper to check for specific non-Ajax requests.
> >>> --
> >>> Jurian Sluiman
> >>> CTO Soflomo V.O.F.
> >>> http://soflomo.com
> >>
> >>
> >
> >
> >
> > --
> > A.J. Brown
> > Software Engineer, ZCE
> > blog : http://ajbrown.org
> > talk  : (937) 540-0099
> > chat : IntypicaAJ
> >
>
>
>
> --
> A.J. Brown
> Software Engineer, ZCE
> blog : http://ajbrown.org
> talk  : (937) 540-0099
> chat : IntypicaAJ
>

Reply via email to