summaryrefslogtreecommitdiffstats
path: root/user_guide/general/helpers.html
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2011-07-02 00:40:48 +0200
committerDerek Jones <derek.jones@ellislab.com>2011-07-02 00:40:48 +0200
commit4b9c62980599228f070b401c7673dce8085b0c61 (patch)
tree314bd87831a09913cbbfd1ffe1447b3c38b394c5 /user_guide/general/helpers.html
parent114ab0988e20ac6be39ad363ff897a1a3b85e565 (diff)
backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance
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 99f47178e..339a0df02 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 locate
<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>