Static Pages

2 messages Options
Embed this post
Permalink
Zachary

Static Pages

Reply Threaded More More options
Print post
Permalink
David,

Loved the book.  Have found it very helpful in learning CakePHP.



There doesn't seem to be much info on how to create static pages.  Do you have any good resources?  For instance, what if I wanted an About or Contact page (and subsequent links in the navigation).  



Thanks.
davidgolding

Re: Static Pages

Reply Threaded More More options
Print post
Permalink
The easiest way, IMO, is to use the Pages controller (which is built-into Cake). In other words, for an about page, just go to the app/views/pages folder and create the about.ctp file. Put in it whatever HTML/PHP you'd like. Then, you can go to http://localhost/app/pages/about and it will display the page. If you want this route to appear differently, just use the Routes configuration to make the setting. It will be through

'controller'=>'pages','action'=>'display','about'

--Dave

Author, "Beginning CakePHP: From Novice to Professional"

[ get your copy at: http://www.amazon.com/Beginning-CakePHP-Novice-Professional/dp/1430209771/ ]