$layout refers to the template you'd like the view to utilise. You store those in /app/views/layouts/ with a .ctp extension. When setting the $layout var just give the filename, without the extension.
$content_for_layout is, basically, what your view is emitting to the layout template. So, if you have an "list" view that creates an unordered list, your list.ctp would contain the HTML markup (and, probably, a loop to run through the contents of whatever your list() controller method passes). The final result would be your $content_for_layout in the the layout template. Create your layout template such that the $content_for_layout var is positioned wherever you'd like whatever it is the view is creating. In a nutshell, $layout refers to a template name and $content_for_layout to the result of your view's manipulation of the data passed from the controller. On Fri, Feb 22, 2008 at 8:21 PM, jim starboard <[EMAIL PROTECTED]> wrote: > > In a view you have $content_for_layout but in the controller you set > it with $layout. What is the motivation behind this? > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
