summaryrefslogtreecommitdiffstats
path: root/user_guide/general/helpers.html
diff options
context:
space:
mode:
authorGreg Aker <greg.aker@ellislab.com>2011-04-27 08:47:47 +0200
committerGreg Aker <greg.aker@ellislab.com>2011-04-27 08:47:47 +0200
commita6507905578f1cf209776ae3d53099a005a06823 (patch)
tree9f23bb557f920034cf65c86059c84e37efd34d79 /user_guide/general/helpers.html
parent60ef4ea72e169e174ff8dbb421609a178a3c0c48 (diff)
parent25d495b4a2598f771a858108a2cd2e96f0130412 (diff)
merging in changes
Diffstat (limited to 'user_guide/general/helpers.html')
-rw-r--r--user_guide/general/helpers.html26
1 files changed, 13 insertions, 13 deletions
diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html
index 339a0df02..99f47178e 100644
--- a/user_guide/general/helpers.html
+++ b/user_guide/general/helpers.html
@@ -57,20 +57,20 @@ Helper Functions
<h1>Helper Functions</h1>
-<p>Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular
-category. There are <dfn>URL Helpers</dfn>, that assist in creating links, there are <dfn>Form Helpers</dfn>
+<p>Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular
+category. There are <dfn>URL Helpers</dfn>, that assist in creating links, there are <dfn>Form Helpers</dfn>
that help you create form elements, <dfn>Text Helpers</dfn> perform various text formatting routines,
<dfn>Cookie Helpers</dfn> set and read cookies, <dfn>File Helpers</dfn> help you deal with files, etc.
</p>
-<p>Unlike most other systems in CodeIgniter, Helpers are not written in an Object Oriented format. They are simple, procedural functions.
+<p>Unlike most other systems in CodeIgniter, Helpers are not written in an Object Oriented format. They are simple, procedural functions.
Each helper function performs one specific task, with no dependence on other functions.</p>
<p>CodeIgniter does not load Helper Files by default, so the first step in using
-a Helper is to load it. Once loaded, it becomes globally available in your <a href="../general/controllers.html">controller</a> and <a href="../general/views.html">views</a>.</p>
+a Helper is to load it. Once loaded, it becomes globally available in your <a href="../general/controllers.html">controller</a> and <a href="../general/views.html">views</a>.</p>
<p>Helpers are typically stored in your <dfn>system/helpers</dfn>, or <dfn>application/helpers </dfn>directory. CodeIgniter will look first in your <dfn>application/helpers</dfn>
-directory. If the directory does not exist or the specified helper is not located there CI will instead look in your global
+directory. If the directory does not exist or the specified helper is not located there CI will instead look in your global
<dfn>system/helpers</dfn> folder.</p>
@@ -87,10 +87,10 @@ directory. If the directory does not exist or the specified helper is not locat
<code>$this->load->helper('<var>url</var>');</code>
<p>A helper can be loaded anywhere within your controller functions (or even within your View files, although that's not a good practice),
-as long as you load it before you use it. You can load your helpers in your controller constructor so that they become available
+as long as you load it before you use it. You can load your helpers in your controller constructor so that they become available
automatically in any function, or you can load a helper in a specific function that needs it.</p>
-<p class="important">Note: The Helper loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.</p>
+<p class="important">Note: The Helper loading function above does not return a value, so don't try to assign it to a variable. Just use it as shown.</p>
<h2>Loading Multiple Helpers</h2>
@@ -117,12 +117,12 @@ This is done by opening the <var>application/config/autoload.php</var> file and
<h2>"Extending" Helpers</h2>
-<p>To "extend" Helpers, create a file in your <dfn>application/helpers/</dfn> folder with an identical name to the existing Helper, but prefixed with <kbd>MY_</kbd> (this item is configurable. See below.).</p>
+<p>To "extend" Helpers, create a file in your <dfn>application/helpers/</dfn> folder with an identical name to the existing Helper, but prefixed with <kbd>MY_</kbd> (this item is configurable. See below.).</p>
<p>If all you need to do is add some functionality to an existing helper - perhaps add a function or two, or change how a particular
- helper function operates - then it's overkill to replace the entire helper with your version. In this case it's better to simply
- "extend" the Helper. The term "extend" is used loosely since Helper functions are procedural and discrete and cannot be extended
- in the traditional programmatic sense. Under the hood, this gives you the ability to add to the functions a Helper provides,
+ helper function operates - then it's overkill to replace the entire helper with your version. In this case it's better to simply
+ "extend" the Helper. The term "extend" is used loosely since Helper functions are procedural and discrete and cannot be extended
+ in the traditional programmatic sense. Under the hood, this gives you the ability to add to the functions a Helper provides,
or to modify how the native Helper functions operate.</p>
<p>For example, to extend the native <kbd>Array Helper</kbd> you'll create a file named <dfn>application/helpers/</dfn><kbd>MY_array_helper.php</kbd>, and add or override functions:</p>
@@ -154,7 +154,7 @@ function random_element($array)<br />
<h3>Setting Your Own Prefix</h3>
-<p>The filename prefix for "extending" Helpers is the same used to extend libraries and Core classes. To set your own prefix, open your <dfn>application/config/config.php</dfn> file and look for this item:</p>
+<p>The filename prefix for "extending" Helpers is the same used to extend libraries and Core classes. To set your own prefix, open your <dfn>application/config/config.php</dfn> file and look for this item:</p>
<code>$config['subclass_prefix'] = 'MY_';</code>
@@ -163,7 +163,7 @@ function random_element($array)<br />
<h2>Now What?</h2>
-<p>In the Table of Contents you'll find a list of all the available Helper Files. Browse each one to see what they do.</p>
+<p>In the Table of Contents you'll find a list of all the available Helper Files. Browse each one to see what they do.</p>
</div>