summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/general
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-01 18:55:42 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-01 18:55:42 +0100
commitd1097a1dc30f40c68bc4a5c89d3fadb295c55e56 (patch)
treebc5e12c402d1abb6b00e064161f76aa3bf543189 /user_guide_src/source/general
parent8161e57a1c038566ff28a6ba08c9b165079c9b75 (diff)
Allow use of dashes in controller/method URI segments
Supersedes PR #642
Diffstat (limited to 'user_guide_src/source/general')
-rw-r--r--user_guide_src/source/general/routing.rst6
-rw-r--r--user_guide_src/source/general/urls.rst27
2 files changed, 26 insertions, 7 deletions
diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst
index 43c181669..e6174cc0d 100644
--- a/user_guide_src/source/general/routing.rst
+++ b/user_guide_src/source/general/routing.rst
@@ -162,8 +162,8 @@ appear by default.
This route indicates which controller class should be loaded if the
requested controller is not found. It will override the default 404
error page. It won't affect to the show_404() function, which will
-continue loading the default error_404.php file at
-application/errors/error_404.php.
+continue loading the default *error_404.php* file at
+*application/errors/error_404.php*.
.. important:: The reserved routes must come before any wildcard or
- regular expression routes.
+ regular expression routes. \ No newline at end of file
diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst
index 6b390b559..20f80632a 100644
--- a/user_guide_src/source/general/urls.rst
+++ b/user_guide_src/source/general/urls.rst
@@ -28,9 +28,28 @@ approach, usually represent::
#. The third, and any additional segments, represent the ID and any
variables that will be passed to the controller.
-The :doc:`URI Class <../libraries/uri>` and the :doc:`URL Helper <../helpers/url_helper>` contain functions that make it
-easy to work with your URI data. In addition, your URLs can be remapped
-using the :doc:`URI Routing <routing>` feature for more flexibility.
+The :doc:`URI Class <../libraries/uri>` and the :doc:`URL Helper <../helpers/url_helper>`
+contain functions that make it easy to work with your URI data. In addition,
+your URLs can be remapped using the :doc:`URI Routing <routing>` feature for
+more flexibility.
+
+Friendly URLs
+=============
+
+As you might guess, since there's a straight relationship between
+URI segments and the controller/method pair that's being called,
+those two determining segments must represent a valid class and
+method name.
+You may however also use dashes in the class/method-representing
+segments, and they will automatically be translated to underscores
+in order to be valid routed segments.
+
+For example::
+
+ example.com/my-settings/change-password/
+
+The above example will route to the ``My_settings`` controller and
+its method ``change_password()``.
Removing the index.php file
===========================
@@ -94,4 +113,4 @@ active. Your controllers and functions will then be accessible using the
.. note:: If you are using query strings you will have to build
your own URLs, rather than utilizing the URL helpers (and other helpers
that generate URLs, like some of the form helpers) as these are designed
- to work with segment based URLs.
+ to work with segment based URLs. \ No newline at end of file