Return to Snippet

Revision: 29076
at July 21, 2010 01:26 by TioSolid


Initial Code
//No Source, check comments

Initial URL
http://www.avatarfinancial.com/pages/cake

Initial Description
I needed to create several pages that didn't use any models and contained static data inside the default layout. My first thought was to create a controller for these pages and define an action for each static page I needed. However, this solution seemed tedious and would make it difficult to quickly add new pages. Enter the pages controller - simply create a view inside the views/pages/ folder and it'll automatically be rendered in /pages. For example, if I created /views/pages/matt.thtml it would be accessible via http://www.example.com/pages/matt

Initial Title
Easily creating static pages

Initial Tags
cakephp

Initial Language
PHP