diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-20 14:03:43 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-20 14:03:43 +0100 |
commit | ea801ab4ab80042638ffddc6056483a1ec43fa80 (patch) | |
tree | f75f30c0df6a8f861ca7df22af09fa3240b0bbd6 /user_guide_src/source/general/controllers.rst | |
parent | 1c08d557a21ecb0f79cd1a1de4e06817a26e0537 (diff) | |
parent | 4d0571666d03511ac5b4a1f2a6882ccb1509a209 (diff) |
Merge branch 'develop' into feature/user-guide-cleanup
Diffstat (limited to 'user_guide_src/source/general/controllers.rst')
-rw-r--r-- | user_guide_src/source/general/controllers.rst | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst index 04f23276d..d8ef824fb 100644 --- a/user_guide_src/source/general/controllers.rst +++ b/user_guide_src/source/general/controllers.rst @@ -18,7 +18,7 @@ Consider this URI:: example.com/index.php/blog/ In the above example, CodeIgniter would attempt to find a controller -named blog.php and load it. +named Blog.php and load it. **When a controller's name matches the first segment of a URI, it will be loaded.** @@ -27,7 +27,7 @@ Let's try it: Hello World! ========================== Let's create a simple controller so you can see it in action. Using your -text editor, create a file called blog.php, and put the following code +text editor, create a file called Blog.php, and put the following code in it:: <?php @@ -41,6 +41,8 @@ in it:: Then save the file to your *application/controllers/* directory. +.. important:: The file must be called 'Blog.php', with a capital 'B'. + Now visit the your site using a URL similar to this:: example.com/index.php/blog/ @@ -136,7 +138,7 @@ present, as will be the case when only your site root URL is requested. To specify a default controller, open your **application/config/routes.php** file and set this variable:: - $route['default_controller'] = 'blog'; + $route['default_controller'] = 'Blog'; 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 @@ -272,7 +274,7 @@ and place your controller classes within them. specify the folder. For example, let's say you have a controller located here:: - application/controllers/products/shoes.php + application/controllers/products/Shoes.php To call the above controller your URI will look something like this:: |