root/trunk/system/config/routes.php

Revision 3408, 1.1 kB (checked in by Geert, 6 weeks ago)

The mandatory router (regex) optimizations everybody was waiting for:

  • compile() about 15% faster now
  • keys() about 10% faster now
  • other minor cleanups
  • Property svn:eol-style set to LF
  • Property copyright set to Copyright (c) 2007 Kohana Team
  • Property svn:keywords set to Id
Line 
1<?php
2/**
3 * @package  Core
4 *
5 * Sets default routing, allowing up to 3 segments to be used.
6 *
7 *     $config['default'] = array
8 *     (
9 *         // Default routing
10 *         :controller/:method/:id',
11 *         
12 *         // Defaults for route keys
13 *         'controller' => 'welcome',
14 *         'method' => 'index',
15 *     );
16 *
17 * The converted regex for this route is:
18 *
19 *     (?:([^/]++)(?:/([^/]++)(?:/([^/]++))?)?)?
20 *
21 * To define a specific pattern for a key, you can use the special "regex" key:
22 *
23 *     $config['default'] = array
24 *     (
25 *         // Limit the controller to letters and underscores
26 *         'regex' => array('controller' => '[a-z_]+'),
27 *     );
28 *
29 * To add a prefix to any key, you can use the special "prefix" key:
30 *
31 *     $config['admin'] = array
32 *     (
33 *         'admin/:controller/:method/:id',
34 *         
35 *         // Will change all controllers to admin_:controller
36 *         'prefix' => array('controller' => 'admin_'),
37 *     );
38 *
39 */
40$config['default'] = array
41(
42    // Default routing
43    ':controller/:method/:id',
44
45    // Defaults for route keys
46    'controller' => 'welcome',
47    'method' => 'index',
48);
Note: See TracBrowser for help on using the browser.