It's actually fairly simple to do. I won't re-type all of the information from the manual, but if you are using CakePHP 1.2.xx, layouts are explained in detail on this page: http://manual.cakephp.org/view/94/views#layouts-96. The way this works out, is that your layout is the background information of the pages that is the same throughout your application, things such as the <head></head> declarations, and maybe a default image of some such.
To utilize this functionality, for your news() function, there's a few simple steps to take. A)Create the news() function in the controller you are using, I'll use Posts in this example. B)go to /app/views/posts (make it if it's not there), and create the file news.ctp C)Open up news.ctp in your editor-of-choice, and insert everything that you would like to appear in the news() section of your page. D)go to http://yoursitehere.com/posts/news When you go there, you should see all of the information contained in the layout, and wherever you placed the <?php echo $content_for_layout; ?> tag, that is where everything that you placed in your app/views/posts/news.ctp file will be contained. Hope this explains things! In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) On Fri, Jun 20, 2008 at 03:16, meximex <[EMAIL PROTECTED]> wrote: > > hi, > i am trying to build a cakephp website. > > 1. where do i set up my main layout, the header of the page the menu > etc. I want to have my views and the controller stuff inside a design. > in normal(and very simple) php i would create a html and have an > include a the position where the dynamic content starts. > > 2. how can i design a view for lets say news and then include this > finished view as a small area inside a table of the main layout? > > i would be very happy if you could help me. > > are there any example applications where i can look up stuff like > that? any howto recommandations beside the blog howto, i did that > already. > > thx, > meximex > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---