summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/general/routing.rst
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-07-19 15:25:51 +0200
committerAndrey Andreev <narf@devilix.net>2013-07-19 18:06:55 +0200
commit08fec7bdf846daa3dfa4114310f065294ac092fc (patch)
tree59dbd8b39a0064651339f7543993df8f67871db5 /user_guide_src/source/general/routing.rst
parent279c76cb3565672594c4e18dd070cb1e1fe38db9 (diff)
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)
Diffstat (limited to 'user_guide_src/source/general/routing.rst')
-rw-r--r--user_guide_src/source/general/routing.rst14
1 files changed, 13 insertions, 1 deletions
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