From ee2ece8f59338087cef911073d16b2ee407a31bb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 28 Sep 2015 13:18:05 +0300 Subject: [ci skip] Clarify docs about default_controller --- user_guide_src/source/general/controllers.rst | 22 +++++++++++++--------- user_guide_src/source/general/routing.rst | 15 ++++++++++----- 2 files changed, 23 insertions(+), 14 deletions(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst index 7ab5a7f6a..7efb9349e 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 ` 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 ` feature. diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst index 766e0b2ab..dc5c0201e 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. :: -- cgit v1.2.3-24-g4f1b From 7f5c7533312d38ea922e6068cd097bf694fa3907 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 28 Sep 2015 17:05:52 +0300 Subject: [ci skip] Explain per-directory logic for 404_override too --- user_guide_src/source/general/routing.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/routing.rst b/user_guide_src/source/general/routing.rst index dc5c0201e..b2c9873ab 100644 --- a/user_guide_src/source/general/routing.rst +++ b/user_guide_src/source/general/routing.rst @@ -187,11 +187,13 @@ will 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; -- cgit v1.2.3-24-g4f1b From c094becbcaf95fa8700ef7fc73c0b2bf808801a9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 8 Oct 2015 17:18:57 +0300 Subject: [ci skip] Fix broken links in user guide --- user_guide_src/source/general/controllers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst index 7efb9349e..5a111d8dc 100644 --- a/user_guide_src/source/general/controllers.rst +++ b/user_guide_src/source/general/controllers.rst @@ -145,7 +145,7 @@ load your main index.php file without specifying any URI segments you'll see your "Hello World" message by default. For more information, please refer to the "Reserved Routes" section of the -:doc:`URI Routing ` documentation. +:doc:`URI Routing ` documentation. Remapping Method Calls ====================== -- cgit v1.2.3-24-g4f1b From 4bb2b95a1b1f580427680c3bef71888e98c25523 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Oct 2015 13:55:24 +0300 Subject: [ci skip] Add more info about security reporting to docs --- user_guide_src/source/general/security.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user_guide_src/source/general') 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 ============ -- cgit v1.2.3-24-g4f1b