Cheers Tim,
Revised AJAX call in the MVC Controller:
function ajaxLoginAction()
{
$this->_helper->viewRenderer->setNoRender(); // Don't look for a view
$this->_helper->layout->disableLayout(); // Don't spit out any global
layout view either
// Do Login Stuff
echo "{success: true}"; // Hoorah
}
Works perfectly
Aaron
----- Original Message -----
From: "Tim Oliver" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, November 03, 2008 12:01 PM
Subject: [phpug] Re: Zend/MVC Framework and Ajax calls
>
> Aaron Cooper wrote:
>> Hi all,
>>
>> I'm working on an integration of Zend FW 1.6 and ExtJS 2 and having a
>> bit of trouble getting my head around just how AJAX should interact with
>> an MVC pattern (if it should at all)
>>
>> Basically, I have an ExtJS login box that I am testing for this purpose.
>> The call seems to be correctly sent to the right mehtod, but because by
>> default the framework attempts to display a View file of the same name,
>> this is failing. All I want is the method to output data in JSON format
>> for ExtJS to work with.
>
> See the bit about setNoRender here:
>
> http://framework.zend.com/manual/en/zend.controller.action.html
>
> --
> Tim Oliver
> [EMAIL PROTECTED]
>
> >
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---