summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/general
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-10-12 16:16:35 +0200
committerAndrey Andreev <narf@devilix.net>2015-10-12 16:16:35 +0200
commit3013f53c59a5d2550a126b1493cf8262bd62dd53 (patch)
tree772e9b569a65e8567c366671373a2700c2028445 /user_guide_src/source/general
parent30f593bbb3408d0c076f2453818c68a7c5c59248 (diff)
parent36a055e49b040e6f18be7bce5e010c2a90d2f44f (diff)
Merge branch '3.0-stable' into develop
Diffstat (limited to 'user_guide_src/source/general')
-rw-r--r--user_guide_src/source/general/controllers.rst22
-rw-r--r--user_guide_src/source/general/routing.rst21
-rw-r--r--user_guide_src/source/general/security.rst3
3 files changed, 30 insertions, 16 deletions
diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst
index 7ab5a7f6a..5a111d8dc 100644
--- a/user_guide_src/source/general/controllers.rst
+++ b/user_guide_src/source/general/controllers.rst
@@ -140,9 +140,12 @@ file and set this variable::
$route['default_controller'] = 'blog';
-Where Blog is the name of the controller class you want used. If you now
+Where 'blog' is the name of the controller class you want used. If you now
load your main index.php file without specifying any URI segments you'll
-see your Hello World message by default.
+see your "Hello World" message by default.
+
+For more information, please refer to the "Reserved Routes" section of the
+:doc:`URI Routing <routing>` documentation.
Remapping Method Calls
======================
@@ -263,12 +266,12 @@ Trying to access it via the URL, like this, will not work::
Organizing Your Controllers into Sub-directories
================================================
-If you are building a large application you might find it convenient to
-organize your controllers into sub-directories. CodeIgniter permits you
-to do this.
+If you are building a large application you might want to hierarchically
+organize or structure your controllers into sub-directories. CodeIgniter
+permits you to do this.
-Simply create folders within your *application/controllers/* directory
-and place your controller classes within them.
+Simply create sub-directories under the main *application/controllers/*
+one and place your controller classes within them.
.. note:: When using this feature the first segment of your URI must
specify the folder. For example, let's say you have a controller located
@@ -281,8 +284,9 @@ and place your controller classes within them.
example.com/index.php/products/shoes/show/123
Each of your sub-directories may contain a default controller which will be
-called if the URL contains only the sub-folder. Simply name your default
-controller as specified in your *application/config/routes.php* file.
+called if the URL contains *only* the sub-directory. Simply put a controller
+in there that matches the name of your 'default_controller' as specified in
+your *application/config/routes.php* file.
CodeIgniter also permits you to remap your URIs using its :doc:`URI
Routing <routing>` feature.
diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst
index 766e0b2ab..b2c9873ab 100644
--- a/user_guide_src/source/general/routing.rst
+++ b/user_guide_src/source/general/routing.rst
@@ -170,11 +170,16 @@ There are three reserved routes::
$route['default_controller'] = 'welcome';
-This route indicates which controller class should be loaded if the URI
-contains no data, which will be the case when people load your root URL.
-In the above example, the "welcome" class would be loaded. You are
-encouraged to always have a default route otherwise a 404 page will
-appear by default.
+This route points to the action that should be executed if the URI contains
+no data, which will be the case when people load your root URL.
+The setting accepts a **controller/method** value and ``index()`` would be
+the default method if you don't specify one. In the above example, it is
+``Welcome::index()`` that would be called.
+
+.. note:: You can NOT use a directory as a part of this setting!
+
+You are encouraged to always have a default route as otherwise a 404 page
+will appear by default.
::
@@ -182,11 +187,13 @@ 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
+error page. Same per-directory rules as with 'default_controller'
+apply here as well.
+
+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;
diff --git a/user_guide_src/source/general/security.rst b/user_guide_src/source/general/security.rst
index d4120d162..8afdaca31 100644
--- a/user_guide_src/source/general/security.rst
+++ b/user_guide_src/source/general/security.rst
@@ -5,6 +5,9 @@ Security
This page describes some "best practices" regarding web security, and
details CodeIgniter's internal security features.
+.. note:: If you came here looking for a security contact, please refer to
+ our `Contribution Guide <../contributing/index>`.
+
URI Security
============