CakePHP Tip: Routing for static pages

Woo, my first CakePHP Tip!

Add the following to /app/config/routes.php:

Router::connect(’/contact’, array(’controller’ => ‘pages’, ‘action’ => ‘display’, ‘contact’));

and create your contact page at:

/app/views/pages/contact.ctp

You can now access the contact page at:

http://foo.com/contact