From 08fec7bdf846daa3dfa4114310f065294ac092fc Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 19 Jul 2013 16:25:51 +0300 Subject: Router improvements - Make dashes-to-underscores URI segment replacement configurable via ['translate_uri_dashes']. - Make _set_routing() protected and move the call to the class constructor. - Remove redudant calls to set_class() and set_method(). - Clean-up/optimize the routes loading procedure. (fixes issue #2503) --- application/config/routes.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'application/config') diff --git a/application/config/routes.php b/application/config/routes.php index a5047a14e..3078c3c76 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -49,7 +49,7 @@ | RESERVED ROUTES | ------------------------------------------------------------------------- | -| There are two reserved routes: +| There are three reserved routes: | | $route['default_controller'] = 'welcome'; | @@ -62,10 +62,20 @@ | This route will tell the Router which controller/method to use if those | provided in the URL cannot be matched to a valid route. | +| $route['translate_uri_dashes'] = FALSE; +| +| This is not exactly a route, but allows you to automatically route +| controller and method names that contain dashes. '-' isn't a valid +| class or method name character, so it requires translation. +| When you set this option to TRUE, it will replace ALL dashes in the +| controller and method URI segments. +| +| Examples: my-controller/index -> my_controller/index +| my-controller/my-method -> my_controller/my_method */ - $route['default_controller'] = 'welcome'; $route['404_override'] = ''; +$route['translate_uri_dashes'] = FALSE; /* End of file routes.php */ /* Location: ./application/config/routes.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b