summaryrefslogtreecommitdiffstats
path: root/application
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 /application
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 'application')
-rw-r--r--application/config/routes.php14
1 files changed, 12 insertions, 2 deletions
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