On a related note,
You can copy the mechanism used by scriptac to easily identify Ajax
requests, i.e in your ajax call set a custom header identical to the
scriptac one, then in your app controller, you can use the request
component and do somethign like

if($rqst->isAjax()) $this->layout=´ajax´,

Then all your ajax requests will have no layout.



On Apr 10, 6:35 pm, "rstuker" <[EMAIL PROTECTED]> wrote:
> THANKS a lot ianh, worked with "$this->layout="ajax";". I had tried it
> before but somehow it didn't worked, now, finally  we succeeded.
> thanks you very much again!!
> On Apr 10, 10:47 am, "ianh" <[EMAIL PROTECTED]> wrote:
>
> > Somewhere in the manual or the API there are two possiblities you can
> > use in your controller method, either:
>
> > $this->autoRender = false; // will tell the method not to render
> > anything, e.g. if no data is being returned
>
> > or $this->layout = 'ajax'; // will tell the method to use a blank
> > layout which will be rendered in whatever DOM element you have
> > specified in the Ajax call.
>
> > On 10 Apr, 05:15, "rstuker" <[EMAIL PROTECTED]> wrote:
>
> > > Hi everyone! I'am new in cake plus php. This is the situation, I use a
> > > default page for my site, which contain the menu of it, located in /
> > > app/views/layout/default.thtml. Ok, it is fine, however I do some data
> > > insert using ajax (native, not using $ajax->) and expects in the
> > > XMLHttpRequestObject a simple request of what I have just Inserted. It
> > > does work, but it also show me my menu again in  the div where the
> > > response is being shown. I whish I could tell cake.."do not use this
> > > layaout  in this case, just give me the XMLHttprequest.responde, do no
> > > add the default layout again". Should it be told in the controller?
> > > well, i hope it can be understood my point . Thanks in advance..


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
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