Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  Router::connect('/', array('controller' => 'pages', 'action' => 'view', array('slug'=>'home')));
  3. /**
  4.  * ...and connect the rest of 'Pages' controller's urls.
  5.  */
  6. /**
  7.  * Grab the controller functions
  8.  */
  9.  Router::connect('/:controller/', array('action' => 'view'));
  10.  Router::connect('/:controller/*', array('action' => 'view'));
  11. /**
  12.  * Capture all other slugs
  13.  */
  14.  Router::connect('/:slug', array('controller' => 'pages', 'action' => 'view'), array('slug' => '[a-zA-Z0-9_-]+'));
  15.  
  16. /**
  17.  * Admin routing for all admin related tasks
  18.  */
  19.  Router::connect('/admin', array('controller' => 'pages', 'action' => 'index', 'admin' => true));