Posted By

TioSolid on 07/21/10


Tagged

cakephp


Versions (?)

Easily creating static pages


 / Published in: PHP
 

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

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

  1. //No Source, check comments

Report this snippet  

You need to login to post a comment.