From 619b122cc8c213df558838ce9cc1c157a85a65b6 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 10 Oct 2011 16:26:27 -0500 Subject: incremental improvement to user guide ToC --- user_guide_src/source/general/index.rst | 32 +++++++++++++++++++++++++--- user_guide_src/source/general/styleguide.rst | 7 +++--- 2 files changed, 33 insertions(+), 6 deletions(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/index.rst b/user_guide_src/source/general/index.rst index 1ece12bef..2bc684a1d 100644 --- a/user_guide_src/source/general/index.rst +++ b/user_guide_src/source/general/index.rst @@ -1,6 +1,32 @@ +############## +General Topics +############## + .. toctree:: - :glob: - :hidden: :titlesonly: - * \ No newline at end of file + urls + controllers + reserved_names + views + models + Helpers + libraries + creating_libraries + drivers + creating_drivers + core_classes + ancillary_classes + hooks + autoloader + common_functions + routing + errors + Caching + profiling + cli + managing_apps + environments + alternative_php + security + PHP Style Guide \ No newline at end of file diff --git a/user_guide_src/source/general/styleguide.rst b/user_guide_src/source/general/styleguide.rst index 0373fc791..b3dc08871 100644 --- a/user_guide_src/source/general/styleguide.rst +++ b/user_guide_src/source/general/styleguide.rst @@ -1,6 +1,7 @@ -######################## -General Style and Syntax -######################## +############### +PHP Style Guide +############### + The following page describes the use of coding rules adhered to when developing CodeIgniter. -- cgit v1.2.3-24-g4f1b From 9286a8f71305f557997401b55138e8ef483839f9 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 10 Oct 2011 16:46:43 -0500 Subject: unhid general topics ToC for navigation --- user_guide_src/source/general/index.rst | 1 - 1 file changed, 1 deletion(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/index.rst b/user_guide_src/source/general/index.rst index 1335e9dd4..2162b8140 100644 --- a/user_guide_src/source/general/index.rst +++ b/user_guide_src/source/general/index.rst @@ -4,7 +4,6 @@ General Topics .. toctree:: :titlesonly: - :hidden: urls controllers -- cgit v1.2.3-24-g4f1b From ed477270cca24e91941d947c00370ee8712e5fac Mon Sep 17 00:00:00 2001 From: Repox Date: Tue, 22 Nov 2011 11:13:48 +0100 Subject: Altered the suggested mod_rewrite rules for removing index.php from URL to better fit the needs between CI routing and asset files. This suggestion addresses issue #684 --- user_guide_src/source/general/urls.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst index 211537675..6618aeece 100644 --- a/user_guide_src/source/general/urls.rst +++ b/user_guide_src/source/general/urls.rst @@ -45,12 +45,13 @@ method in which everything is redirected except the specified items: :: - RewriteEngine on - RewriteCond $1 !^(index\.php|images|robots\.txt) + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] -In the above example, any HTTP request other than those for index.php, -images, and robots.txt is treated as a request for your index.php file. +In the above example, any HTTP request other than those for index.php, existing +directories and existing files is treated as a request for your index.php file. Adding a URL Suffix =================== -- cgit v1.2.3-24-g4f1b From 1f9a40f2465ee135d4ed0292d51a1ed6571173f0 Mon Sep 17 00:00:00 2001 From: Repox Date: Tue, 22 Nov 2011 11:25:24 +0100 Subject: Altered the explenation of the rewrite rules to better fit the actual result. --- user_guide_src/source/general/urls.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst index 6618aeece..3126fcf36 100644 --- a/user_guide_src/source/general/urls.rst +++ b/user_guide_src/source/general/urls.rst @@ -50,7 +50,7 @@ method in which everything is redirected except the specified items: RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] -In the above example, any HTTP request other than those for index.php, existing +In the above example, any HTTP request other than those for existing directories and existing files is treated as a request for your index.php file. Adding a URL Suffix -- cgit v1.2.3-24-g4f1b From 5287f6643f5ca55c360a6372c526c8c06c0c4912 Mon Sep 17 00:00:00 2001 From: insign Date: Mon, 9 Jan 2012 18:07:34 -0200 Subject: Removed the first slash of the line 51. With this, the goal of the code don't work. I tried it in many Apache servers. Sorry if I am wrong. --- user_guide_src/source/general/urls.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst index 3126fcf36..857078b1c 100644 --- a/user_guide_src/source/general/urls.rst +++ b/user_guide_src/source/general/urls.rst @@ -48,7 +48,7 @@ method in which everything is redirected except the specified items: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.*)$ /index.php/$1 [L] + RewriteRule ^(.*)$ index.php/$1 [L] In the above example, any HTTP request other than those for existing directories and existing files is treated as a request for your index.php file. -- cgit v1.2.3-24-g4f1b From 624010f68be35000b8518be25375d8cb4078225f Mon Sep 17 00:00:00 2001 From: CroNiX Date: Wed, 25 Jan 2012 14:52:11 -0800 Subject: Added bit about having mod_rewrite enabled for removing index.php Added note about htaccess rules might not work for all server configurations --- user_guide_src/source/general/urls.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst index 857078b1c..6b390b559 100644 --- a/user_guide_src/source/general/urls.rst +++ b/user_guide_src/source/general/urls.rst @@ -39,9 +39,10 @@ By default, the **index.php** file will be included in your URLs:: example.com/index.php/news/article/my_article -You can easily remove this file by using a .htaccess file with some -simple rules. Here is an example of such a file, using the "negative" -method in which everything is redirected except the specified items: +If your Apache server has mod_rewrite enabled, you can easily remove this +file by using a .htaccess file with some simple rules. Here is an example +of such a file, using the "negative" method in which everything is redirected +except the specified items: :: @@ -53,6 +54,8 @@ method in which everything is redirected except the specified items: In the above example, any HTTP request other than those for existing directories and existing files is treated as a request for your index.php file. +.. note:: Note: These specific rules might not work for all server configurations. + Adding a URL Suffix =================== -- cgit v1.2.3-24-g4f1b From 82c83078a91acc3ce25572e28096b0b4bbe8d67c Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 26 Jan 2012 19:02:05 -0500 Subject: Added try catch example in style guide --- user_guide_src/source/general/styleguide.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'user_guide_src/source/general') diff --git a/user_guide_src/source/general/styleguide.rst b/user_guide_src/source/general/styleguide.rst index b3dc08871..d8bdd0531 100644 --- a/user_guide_src/source/general/styleguide.rst +++ b/user_guide_src/source/general/styleguide.rst @@ -441,6 +441,13 @@ same level as the control statement that "owns" them. // ... } } + + try { + // ... + } + catch() { + // ... + } **CORRECT**:: @@ -470,6 +477,15 @@ same level as the control statement that "owns" them. // ... } } + + try + { + // ... + } + catch() + { + // ... + } Bracket and Parenthetic Spacing =============================== -- cgit v1.2.3-24-g4f1b