I believe you can use the RequestHandler (?) component to
automatically check for an AJAX request, and disable layouts based on
that,
so you can eliminate your $layout=false. Just include the
RequestHandler component, and you can also call its isAjax() method to
check for yourself.

I also think you could easily make that action work for both ajax and
non ajax requests-
For example, by:
- redirecting to the index() action, but when you do it in ajax, use
JQuery to extract the flash message from the DOM of the returned page.
- Include a custom header with the response, and use this as the
message, something like X-Ajax-Result, in the same way that the Ajax
call is detected by X-Requested-With. I really like that way as you
can easily do gogle style status updates in the corner by printing
this from eahc ajax call :)

Probably many other ways to skin this cat...



On May 15, 7:40 am, salimk786 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am using jquery and cakephp.
> I wrote some info on this link.
> Can you pls tell me if this is the right way to do it ? or if there is
> a better way ?
>
> http://pastebin.com/m247e9d3d
>
> Thanks
>
> Salim.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to