Show
Ignore:
Timestamp:
08/28/2008 03:10:50 PM (3 months ago)
Author:
Shadowhand
Message:

Follow up to r3366:

  • Updated config and routes configuration comments
  • Added "prefix" to routes, to allow prefixes to be added to any route key
  • Removed slash-to-underscore modification to controller and method keys...that was a bit of a hack, anyways
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/config/routes.php

    r3366 r3381  
    44 * @package  Core 
    55 * 
    6  * Sets default routing, allowing up to 3 segments to be used: 
    7  *  - controller, defaults to "welcome" 
    8  *  - method, defaults to "index" 
    9  *  - id, no default 
     6 * Sets default routing, allowing up to 3 segments to be used. 
     7 * 
     8 *     $config['default'] = array 
     9 *     ( 
     10 *         // Default routing 
     11 *         :controller/:method/:id.xml', 
     12 *     
     13 *         // Defaults for route keys 
     14 *         'controller' => 'welcome', 
     15 *         'method' => 'index', 
     16 *     ); 
    1017 * 
    1118 * The converted regex for this route is: 
    1219 * 
    1320 *     (?:([^/]+)(?:/([^/]+)(?:/([^/]+))?)?)? 
     21 * 
     22 * To define a specific pattern for a key, you can use the special "regex" key: 
     23 * 
     24 *     $config['default'] = array 
     25 *     ( 
     26 *         // Limit the controller to letters and underscores 
     27 *         'regex' => array('controller' => '[a-z_]+'), 
     28 *     ); 
     29 * 
     30 * To add a prefix to any key, you can use the special "prefix" key: 
     31 * 
     32 *     $config['admin'] = array 
     33 *     ( 
     34 *         'admin/:controller/:method/:id', 
     35 * 
     36 *         // Will change all controllers to admin_:controller 
     37 *         'prefix' => array('controller' => 'admin_'), 
     38 *     ); 
    1439 * 
    1540 */