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) --- user_guide_src/source/general/routing.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'user_guide_src/source/general/routing.rst') diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst index 123257fc8..5520f59fe 100644 --- a/user_guide_src/source/general/routing.rst +++ b/user_guide_src/source/general/routing.rst @@ -145,7 +145,7 @@ routing rules to process the back-references. Example:: Reserved Routes =============== -There are two reserved routes:: +There are three reserved routes:: $route['default_controller'] = 'welcome'; @@ -165,5 +165,17 @@ error page. It won't affect to the ``show_404()`` function, which will continue loading the default *error_404.php* file at *application/views/errors/error_404.php*. + +:: + + $route['translate_uri_dashes'] = FALSE; + +As evident by the boolean value, this is not exactly a route. This +option enables you to automatically replace dashes ('-') with +underscores in the controller and method URI segments, thus saving you +additional route entries if you need to do that. +This is required, because the dash isn't a valid class or method name +character and would cause a fatal error if you try to use it. + .. important:: The reserved routes must come before any wildcard or regular expression routes. \ No newline at end of file -- cgit v1.2.3-24-g4f1b