diff options
author | Timothy Warren <tim@timshomepage.net> | 2011-10-07 15:55:27 +0200 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2011-10-07 15:55:27 +0200 |
commit | 486b17c1f39e04c952de995d68412db4d6477c3c (patch) | |
tree | 57a44b04a9cbe570de8f905bb0b2d70c30895cb5 /user_guide_src/source/general | |
parent | ec19332ba3791c933f2221d972ee073684b5ea3b (diff) | |
parent | 0252fc7ddf80262f915b20100107ec79ba3ccf01 (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'user_guide_src/source/general')
-rw-r--r-- | user_guide_src/source/general/cli.rst | 4 | ||||
-rw-r--r-- | user_guide_src/source/general/controllers.rst | 21 | ||||
-rw-r--r-- | user_guide_src/source/general/models.rst | 6 | ||||
-rw-r--r-- | user_guide_src/source/general/profiling.rst | 53 | ||||
-rw-r--r-- | user_guide_src/source/general/urls.rst | 11 | ||||
-rw-r--r-- | user_guide_src/source/general/views.rst | 28 |
6 files changed, 42 insertions, 81 deletions
diff --git a/user_guide_src/source/general/cli.rst b/user_guide_src/source/general/cli.rst index 8fcf31702..7dc1ca319 100644 --- a/user_guide_src/source/general/cli.rst +++ b/user_guide_src/source/general/cli.rst @@ -6,9 +6,7 @@ As well as calling an applications :doc:`Controllers <./controllers>` via the URL in a browser they can also be loaded via the command-line interface (CLI). -- `What is the CLI? <#what>`_ -- `Why use this method? <#why>`_ -- `How does it work? <#how>`_ +.. contents:: Page Contents What is the CLI? ================ diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst index 4d6e8366c..6e5079419 100644 --- a/user_guide_src/source/general/controllers.rst +++ b/user_guide_src/source/general/controllers.rst @@ -5,23 +5,13 @@ Controllers Controllers are the heart of your application, as they determine how HTTP requests should be handled. -- `What is a Controller? <#what>`_ -- `Hello World <#hello>`_ -- `Functions <#functions>`_ -- `Passing URI Segments to Your Functions <#passinguri>`_ -- `Defining a Default Controller <#default>`_ -- `Remapping Function Calls <#remapping>`_ -- `Controlling Output Data <#output>`_ -- `Private Functions <#private>`_ -- `Organizing Controllers into Sub-folders <#subfolders>`_ -- `Class Constructors <#constructors>`_ -- `Reserved Function Names <#reserved>`_ +.. contents:: Page Contents What is a Controller? ===================== -A Controller is simply a class file that is named in a way that can be -associated with a URI. +**A Controller is simply a class file that is named in a way that can be +associated with a URI.** Consider this URI:: @@ -146,7 +136,7 @@ Defining a Default Controller CodeIgniter can be told to load a default controller when a URI is not 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 +To specify a default controller, open your **application/config/routes.php** file and set this variable:: $route['default_controller'] = 'Blog'; @@ -209,8 +199,7 @@ Processing Output CodeIgniter has an output class that takes care of sending your final rendered data to the web browser automatically. More information on this -can be found in the :doc::doc:`Views <views>` and `Output -class <../libraries/output>` pages. In some cases, however, you +can be found in the :doc:`Views <views>` and :doc:`Output class <../libraries/output>` pages. In some cases, however, you might want to post-process the finalized data in some way and send it to the browser yourself. CodeIgniter permits you to add a function named _output() to your controller that will receive the finalized output diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index 55081d12a..4dd3e5765 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -5,11 +5,7 @@ Models Models are **optionally** available for those who want to use a more traditional MVC approach. -- `What is a Model? <#what>`_ -- `Anatomy of a Model <#anatomy>`_ -- `Loading a Model <#loading>`_ -- `Auto-Loading a Model <#auto_load_model>`_ -- `Connecting to your Database <#conn>`_ +.. contents:: Page Contents What is a Model? ================ diff --git a/user_guide_src/source/general/profiling.rst b/user_guide_src/source/general/profiling.rst index 28c1dd7b8..437635289 100644 --- a/user_guide_src/source/general/profiling.rst +++ b/user_guide_src/source/general/profiling.rst @@ -65,40 +65,19 @@ class <../libraries/output>`:: Available sections and the array key used to access them are described in the table below. -Key -Description -Default -**benchmarks** -Elapsed time of Benchmark points and total execution time -TRUE -**config** -CodeIgniter Config variables -TRUE -**controller_info** -The Controller class and method requested -TRUE -**get** -Any GET data passed in the request -TRUE -**http_headers** -The HTTP headers for the current request -TRUE -**memory_usage** -Amount of memory consumed by the current request, in bytes -TRUE -**post** -Any POST data passed in the request -TRUE -**queries** -Listing of all database queries executed, including execution time -TRUE -**uri_string** -The URI of the current request -TRUE -**session_data** -Data stored in the current session -TRUE -**query_toggle_count** -The number of queries after which the query block will default to -hidden. -25 +======================= =================================================================== ======== +Key Description Default +======================= =================================================================== ======== +**benchmarks** Elapsed time of Benchmark points and total execution time TRUE +**config** CodeIgniter Config variables TRUE +**controller_info** The Controller class and method requested TRUE +**get** Any GET data passed in the request TRUE +**http_headers** The HTTP headers for the current request TRUE +**memory_usage** Amount of memory consumed by the current request, in bytes TRUE +**post** Any POST data passed in the request TRUE +**queries** Listing of all database queries executed, including execution time TRUE +**uri_string** The URI of the current request TRUE +**session_data** Data stored in the current session TRUE +**query_toggle_count** The number of queries after which the query block will default to 25 + hidden. +======================= =================================================================== ========
\ 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 db1ffe565..211537675 100644 --- a/user_guide_src/source/general/urls.rst +++ b/user_guide_src/source/general/urls.rst @@ -28,8 +28,7 @@ approach, usually represent:: #. The third, and any additional segments, represent the ID and any variables that will be passed to the controller. -The :doc::doc:`URI Class <../libraries/uri>` and the `URL -Helper <../helpers/url_helper>` contain functions that make it +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. @@ -56,13 +55,13 @@ images, and robots.txt is treated as a request for your index.php file. Adding a URL Suffix =================== -In your config/config.php file you can specify a suffix that will be +In your **config/config.php** file you can specify a suffix that will be added to all URLs generated by CodeIgniter. For example, if a URL is this:: example.com/index.php/products/view/shoes -You can optionally add a suffix, like .html, making the page appear to +You can optionally add a suffix, like **.html,** making the page appear to be of a certain type:: example.com/index.php/products/view/shoes.html @@ -75,7 +74,7 @@ In some cases you might prefer to use query strings URLs:: index.php?c=products&m=view&id=345 CodeIgniter optionally supports this capability, which can be enabled in -your application/config.php file. If you open your config file you'll +your **application/config.php** file. If you open your config file you'll see these items:: $config['enable_query_strings'] = FALSE; @@ -88,7 +87,7 @@ active. Your controllers and functions will then be accessible using the index.php?c=controller&m=method -..note:: If you are using query strings you will have to build +.. 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. diff --git a/user_guide_src/source/general/views.rst b/user_guide_src/source/general/views.rst index 7d0accafd..dc65f6c4f 100644 --- a/user_guide_src/source/general/views.rst +++ b/user_guide_src/source/general/views.rst @@ -24,7 +24,7 @@ in it:: <html> <head> - <title>My Blog</title> + <title>My Blog</title> </head> <body> <h1>Welcome to my Blog!</h1> @@ -141,7 +141,7 @@ to the array keys in your data:: <html> <head> - <title><?php echo $title;?></title> + <title><?php echo $title;?></title> </head> <body> <h1><?php echo $heading;?></h1> @@ -180,27 +180,27 @@ Now open your view file and create a loop:: <html> <head> - <title><?php echo $title;?></title> + <title><?php echo $title;?></title> </head> <body> - <h1><?php echo $heading;?></h1> - - <h3>My Todo List</h3> - - <ul> - <?php foreach ($todo_list as $item):?> - - <li><?php echo $item;?></li> + <h1><?php echo $heading;?></h1> + + <h3>My Todo List</h3> - <?php endforeach;?> - </ul> + <ul> + <?php foreach ($todo_list as $item):?> + + <li><?php echo $item;?></li> + + <?php endforeach;?> + </ul> </body> </html> .. note:: You'll notice that in the example above we are using PHP's alternative syntax. If you are not familiar with it you can read about - it `here </general/alternative_php>`. + it :doc:`here </general/alternative_php>`. Returning views as data ======================= |