Can you show the code where you changed the line ?

I always use
    $this->layout = "ajax";
in the controller method when I want to render the ajax layout.


Friendly greetings,
Bert

On Mon, Sep 28, 2009 at 4:22 PM, Jürgen <[email protected]> wrote:

>
> Anyone?
>
> On 24 sep, 20:01, Jürgen <[email protected]> wrote:
> > Hi,
> >
> > I've just been getting started with Ajax and I've been able to set up
> > a simple website using the pagesController that comes with cake. As
> > for now I'm not yet using any databases.
> >
> > Today I started to try integrating some Ajax in my site. It's quite
> > simple: I want to load the pages into the 'content' div without
> > reloading the entire layout. So what I tried was the following: I
> > edited the pagesController by copying the display function and naming
> > it display_ajax(); Then all I changed was in the last line in the
> > render() function I added 'ajax'.
> >
> > Now when I press an ajax link that loads the new display_ajax function
> > it displays in the 'content' div an error message saying that it can't
> > find the $javascript variable in my default.ctp layout file. That's on
> > the line where I load the javascript files ajax needs.
> >
> > Now maybe I don't really understand how cake works yet, but I think
> > this is weird. First off, I thought by setting the 'ajax' value in the
> > render function, the layout shouldn't be loaded at all. And even if it
> > should (apparently so, can someone explain?) then why does it return
> > this error, when it doesn't return any errors if I use the standard
> > display() function. The functions are the same!
> >
> > I hope someone can help me with this! Thanks.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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