On Jul 8, 4:37 pm, Sir Tabs <[EMAIL PROTECTED]> wrote:
> Two simple questions, with hopefully easy answers:
> ----------------------------
> 1) The render() function and it's paramaters
> ---------------------------
>
> I've been reading forums, snippets of code, this group and the API,
> and I still get confused by the use of the render() function used by
> controllers.
>
> Documentation would suggest that it's:
>
> $this->render($action, $layout, $file);
>
> Where $action is an action/function/something?
$action would refer to the controller action you are rendering ie.
index, add etc. That is the view file that will be loaded if $file is
not filled out.
>
> I've seen in another post that it's more like:
>
> $this->render('myView', 'myLayout');
>
> This makes more sense to me. Does $action really just imply the view
> that's associated with the that particular action?
usually yes.
> I know it's a simple question, but it seems a lot of the official
> documentation is written by people very familiar with their own code -
> which makes it harder for a cakeNoob like me to learn cake.
>
> I would have explored this on my own with experimentation, but I'm
> trying to use it in context of the $ajax->form() method, but am a long
> way off from learning how to use that successfully.
>
> ------------------------------
> 2) An 'ajax' layout?
> ------------------------------
> Whenever I see the snytax " $this->render($action, $layout) " , I see
> most people use 'ajax' for the layout parameter (usually because they
> are using the render method along with some Ajax action). My question:
> is there a universal 'ajax' layout? If so, or even if not, what would
> a typical 'ajax' layout look like?
There is a default ajax.ctp in layouts. You can find it in cake/libs/
view/layouts/ajax.ctp Copying it to your app/views/layouts will allow
you to override and change it.
> Thanks for the help -
> Hopefully it won't be too long before I can provide some help back to
> the community at large.
-Mark
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---