summaryrefslogtreecommitdiffstats
path: root/user_guide
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-08-21 14:46:58 +0200
committerDerek Allard <derek.allard@ellislab.com>2008-08-21 14:46:58 +0200
commit928c55cbc5f3f162c10077f46d75d0bc0b1cbe53 (patch)
tree22b9ca71872be54736e400de93cb7223cbe5ca1d /user_guide
parent993925b47a0bfb08e79961c47bcc3d247a03a5dd (diff)
further whitespace fixes
Diffstat (limited to 'user_guide')
-rw-r--r--user_guide/database/active_record.html74
-rw-r--r--user_guide/database/forge.html62
-rw-r--r--user_guide/database/index.html2
-rw-r--r--user_guide/general/helpers.html2
-rw-r--r--user_guide/general/views.html2
-rw-r--r--user_guide/helpers/form_helper.html12
-rw-r--r--user_guide/helpers/html_helper.html56
-rw-r--r--user_guide/helpers/string_helper.html4
-rw-r--r--user_guide/installation/upgrade_154.html18
-rw-r--r--user_guide/installation/upgrade_160.html20
-rw-r--r--user_guide/libraries/sessions.html155
-rw-r--r--user_guide/libraries/validation.html49
12 files changed, 202 insertions, 254 deletions
diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html
index afdc9b5ef..f3bde15e4 100644
--- a/user_guide/database/active_record.html
+++ b/user_guide/database/active_record.html
@@ -129,8 +129,8 @@ $query = $this->db->get('mytable');<br />
<p class="important"><strong>Note:</strong> If you are selecting all (*) from a table you do not need to use this function. When omitted, CodeIgniter assumes you wish to SELECT *</p>
<p>$this-&gt;db-&gt;select() accepts an optional second parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks. This is useful if you need a compound select statement.</p>
-<p><code> $this-&gt;db-&gt;select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE); <br />
- $query = $this-&gt;db-&gt;get('mytable');<br />
+<p><code>$this-&gt;db-&gt;select('(SELECT SUM(payments.amount) FROM payments WHERE payments.invoice_id=4') AS amount_paid', FALSE); <br />
+$query = $this-&gt;db-&gt;get('mytable');<br />
</code></p>
<h2>$this->db->select_max();</h2>
<p>Writes a "SELECT MAX(field)" portion for your query. You can optionally include a second parameter to rename the resulting field.</p>
@@ -280,30 +280,30 @@ $this->db->or_where('id >', $id);
<h2>$this->db->where_in();</h2>
<p>Generates a WHERE field IN ('item', 'item') SQL query joined with AND if appropriate</p>
<p><code>
- $names = array('Frank', 'Todd', 'James');<br />
- $this->db->where_in('username', $names);<br />
- // Produces: WHERE username IN ('Frank', 'Todd', 'James')</code></p>
+ $names = array('Frank', 'Todd', 'James');<br />
+ $this->db->where_in('username', $names);<br />
+ // Produces: WHERE username IN ('Frank', 'Todd', 'James')</code></p>
<h2>$this->db->or_where_in();</h2>
<p>Generates a WHERE field IN ('item', 'item') SQL query joined with OR if appropriate</p>
<p><code>
- $names = array('Frank', 'Todd', 'James');<br />
- $this->db->or_where_in('username', $names);<br />
- // Produces: OR username IN ('Frank', 'Todd', 'James')</code></p>
-
+ $names = array('Frank', 'Todd', 'James');<br />
+ $this->db->or_where_in('username', $names);<br />
+ // Produces: OR username IN ('Frank', 'Todd', 'James')</code></p>
+
<h2>$this->db->where_not_in();</h2>
<p>Generates a WHERE field NOT IN ('item', 'item') SQL query joined with AND if appropriate</p>
<p><code>
- $names = array('Frank', 'Todd', 'James');<br />
- $this->db->where_not_in('username', $names);<br />
- // Produces: WHERE username NOT IN ('Frank', 'Todd', 'James')</code></p>
+ $names = array('Frank', 'Todd', 'James');<br />
+ $this->db->where_not_in('username', $names);<br />
+ // Produces: WHERE username NOT IN ('Frank', 'Todd', 'James')</code></p>
<h2>$this->db->or_where_not_in();</h2>
<p>Generates a WHERE field NOT IN ('item', 'item') SQL query joined with OR if appropriate</p>
<p><code>
- $names = array('Frank', 'Todd', 'James');<br />
- $this->db->or_where_not_in('username', $names);<br />
- // Produces: OR username NOT IN ('Frank', 'Todd', 'James')</code></p>
+ $names = array('Frank', 'Todd', 'James');<br />
+ $this->db->or_where_not_in('username', $names);<br />
+ // Produces: OR username NOT IN ('Frank', 'Todd', 'James')</code></p>
<h2>$this->db->like();</h2>
<p>This function enables you to generate <strong>LIKE</strong> clauses, useful for doing searches.</p>
@@ -327,7 +327,7 @@ $this->db->or_where('id >', $id);
<code>$this->db->like('title', 'match', 'before');
<br />
// Produces: WHERE title LIKE '%match' <br />
- <br />
+ <br />
$this-&gt;db-&gt;like('title', 'match', 'after'); <br />
// Produces: WHERE title LIKE 'match%' <br />
<br />
@@ -341,7 +341,7 @@ $this->db->or_where('id >', $id);
$this->db->like($array);
<br /><br />// WHERE title LIKE '%match%' AND page1 LIKE '%match%' AND page2 LIKE '%match%'</code></li>
- </ol>
+ </ol>
<h2>$this->db->or_like();</h2>
@@ -387,9 +387,9 @@ $this-&gt;db-&gt;or_not_like('body', 'match'); <br />
</h2>
<p>Adds the &quot;DISTINCT&quot; keyword to a query</p>
<p><code>$this-&gt;db-&gt;distinct();<br />
- $this-&gt;db-&gt;get('table');<br />
- <br />
- // Produces: SELECT DISTINCT * FROM table</code></p>
+ $this-&gt;db-&gt;get('table');<br />
+ <br />
+ // Produces: SELECT DISTINCT * FROM table</code></p>
<h2>$this->db->having();</h2>
<p>Permits you to write the HAVING portion of your query. There are 2 possible syntaxe, 1 argument or 2:</p>
@@ -435,10 +435,10 @@ The second parameter lets you set the direction of the result. Options are <kbd
<p>Or multiple function calls can be made if you need multiple fields.</p>
<p><code>$this->db->order_by("title", "desc");<br />
- $this->db->order_by("name", "asc"); <br />
- <br />
- // Produces: ORDER BY title DESC, name ASC
- </code></p>
+ $this->db->order_by("name", "asc"); <br />
+ <br />
+ // Produces: ORDER BY title DESC, name ASC
+ </code></p>
<p class="important">Note: order_by() was formerly known as orderby(), which has been deprecated.</p>
<p class="important">Note: random ordering is not currently supported in Oracle or MSSQL drivers. These will default to 'ASC'.</p>
<h2>$this->db->limit();</h2>
@@ -543,12 +543,12 @@ $this-&gt;db-&gt;set('status', $status);<br />
$this-&gt;db-&gt;insert('mytable'); </code>
<p><strong>set()</strong> will also accept an optional third parameter ($escape), that will prevent data from being escaped if set to FALSE. To illustrate the difference, here is set() used both with and without the escape parameter.</p>
<p><code>$this-&gt;db-&gt;set('field', 'field+1', FALSE);<br />
- $this-&gt;db-&gt;insert('mytable'); <br />
- // gives INSERT INTO mytable (field) VALUES (field+1)<br />
- <br />
- $this-&gt;db-&gt;set('field', 'field+1');<br />
- $this-&gt;db-&gt;insert('mytable'); <br />
- // gives INSERT INTO mytable (field) VALUES ('field+1')</code></p>
+ $this-&gt;db-&gt;insert('mytable'); <br />
+ // gives INSERT INTO mytable (field) VALUES (field+1)<br />
+ <br />
+ $this-&gt;db-&gt;set('field', 'field+1');<br />
+ $this-&gt;db-&gt;insert('mytable'); <br />
+ // gives INSERT INTO mytable (field) VALUES ('field+1')</code></p>
<p>You can also pass an associative array to this function:</p>
<code>
$array = array('name' => $name, 'title' => $title, 'status' => $status);<br /><br />
@@ -657,19 +657,19 @@ $this->db->delete('mytable', array('id' => $id));
the data to the second parameter of the function:</p>
<p><code> $this->db->where('id', $id);<br />
- $this->db->delete('mytable'); <br />
- <br />
- // Produces:<br />
- // DELETE FROM mytable <br />
- // WHERE id = $id</code></p>
+ $this->db->delete('mytable'); <br />
+ <br />
+ // Produces:<br />
+ // DELETE FROM mytable <br />
+ // WHERE id = $id</code></p>
<p>An array of table names can be passed into delete() if you would like to delete data from more then 1 table.</p>
<p><code>$tables = array('table1', 'table2', 'table3');<br />
$this-&gt;db-&gt;where('id', '5');<br />
$this-&gt;db-&gt;delete($tables);</code></p>
<p>If you want to delete all data from a table, you can use the <dfn>truncate()</dfn> function, or <dfn>empty_table()</dfn>.</p>
<h2>$this-&gt;db-&gt;empty_table();</h2>
-<p>Generates a delete SQL string and runs the query.<code> $this-&gt;db-&gt;empty_table('mytable'); <br />
- <br />
+<p>Generates a delete SQL string and runs the query.<code> $this-&gt;db-&gt;empty_table('mytable'); <br />
+ <br />
// Produces<br />
// DELETE FROM mytable</code></p>
<h2>$this-&gt;db-&gt;truncate();</h2>
diff --git a/user_guide/database/forge.html b/user_guide/database/forge.html
index 12ac62f57..bc67436bb 100644
--- a/user_guide/database/forge.html
+++ b/user_guide/database/forge.html
@@ -116,27 +116,27 @@ already be running, since the forge class relies on it.</p>
<p>Fields are created via an associative array. Within the array you must include a 'type' key that relates to the datatype of the field. For example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR) also require a 'constraint' key.</p>
<p><code>$fields = array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'users' =&gt; array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt; 'VARCHAR',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'constraint' =&gt; '100',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
+ <br />
// will translate to &quot;users VARCHAR(100)&quot; when the field is added.</code></p>
<p>Additionally, the following key/values can be used:</p>
<ul>
- <li>unsigned/true : to generate &quot;UNSIGNED&quot; in the field definition.</li>
- <li>default/value : to generate a default value in the field definition.</li>
- <li>null/true : to generate &quot;NULL&quot; in the field definition. Without this, the field will default to &quot;NOT NULL&quot;.</li>
- <li>auto_increment/true : generates an auto_increment flag on the field. Note that the field type must be a type that supports this, such as integer.</li>
- </ul>
+ <li>unsigned/true : to generate &quot;UNSIGNED&quot; in the field definition.</li>
+ <li>default/value : to generate a default value in the field definition.</li>
+ <li>null/true : to generate &quot;NULL&quot; in the field definition. Without this, the field will default to &quot;NOT NULL&quot;.</li>
+ <li>auto_increment/true : generates an auto_increment flag on the field. Note that the field type must be a type that supports this, such as integer.</li>
+ </ul>
<p><code>$fields = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'blog_id' =&gt; array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
@@ -161,22 +161,22 @@ already be running, since the forge class relies on it.</p>
<h3>Creating an id field</h3>
<p>There is a special exception for creating id fields. A field with type id will automatically be assinged as an INT(9) auto_incrementing Primary Key.</p>
<p><code>$this-&gt;dbforge-&gt;add_field('id');<br />
- // gives id INT(9) NOT NULL AUTO_INCREMENT</code></p>
+ // gives id INT(9) NOT NULL AUTO_INCREMENT</code></p>
<h2><a name="add_key" id="add_key"></a>Adding Keys</h2>
<p>Generally speaking, you'll want your table to have Keys. This is accomplished with <dfn>$this-&gt;dbforge-&gt;add_key('field')</dfn>. An optional second parameter set to TRUE will make it a primary key. Note that <dfn>add_key()</dfn> must be followed by a call to <dfn>create_table()</dfn>.</p>
<p>Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.</p>
<p><code>$this-&gt;dbforge-&gt;add_key('blog_id', TRUE);<br />
- // gives PRIMARY KEY `blog_id` (`blog_id`)<br />
- <br />
- $this-&gt;dbforge-&gt;add_key('blog_id', TRUE);<br />
- $this-&gt;dbforge-&gt;add_key('site_id', TRUE);<br />
- // gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`)<br />
+ // gives PRIMARY KEY `blog_id` (`blog_id`)<br />
+ <br />
+ $this-&gt;dbforge-&gt;add_key('blog_id', TRUE);<br />
+ $this-&gt;dbforge-&gt;add_key('site_id', TRUE);<br />
+ // gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`)<br />
<br />
- $this-&gt;dbforge-&gt;add_key('blog_name');<br />
- // gives KEY `blog_name` (`blog_name`)<br />
- <br />
- $this-&gt;dbforge-&gt;add_key(array('blog_name', 'blog_label'));<br />
- // gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)</code></p>
+ $this-&gt;dbforge-&gt;add_key('blog_name');<br />
+ // gives KEY `blog_name` (`blog_name`)<br />
+ <br />
+ $this-&gt;dbforge-&gt;add_key(array('blog_name', 'blog_label'));<br />
+ // gives KEY `blog_name_blog_label` (`blog_name`, `blog_label`)</code></p>
<h2><a name="create_table" id="create_table"></a>Creating a table</h2>
<p>After fields and keys have been declared, you can create a new table with</p>
<p><code>$this-&gt;dbforge-&gt;create_table('table_name');<br />
@@ -196,7 +196,7 @@ already be running, since the forge class relies on it.</p>
<h2>$this-&gt;dbforge-&gt;add_column()</h2>
<p>The add_column() function is used to modify an existing table. It accepts the same field array as above, and can be used for an unlimited number of additional fields.</p>
<p><code>$fields = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'preferences' =&gt; array('type' =&gt; 'TEXT')<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'preferences' =&gt; array('type' =&gt; 'TEXT')<br />
);<br />
$this-&gt;dbforge-&gt;add_column('table_name', $fields);<br />
<br />
@@ -213,8 +213,8 @@ $this-&gt;dbforge-&gt;add_column('table_name', $fields);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br />
);<br />
$this-&gt;dbforge-&gt;modify_column('table_name', $fields);<br />
- <br />
- // gives ALTER TABLE table_name CHANGE old_name new_name TEXT </code></p>
+ <br />
+ // gives ALTER TABLE table_name CHANGE old_name new_name TEXT </code></p>
<p>&nbsp;</p>
</div>
<!-- END CONTENT -->
diff --git a/user_guide/database/index.html b/user_guide/database/index.html
index a6854b5bb..5dcea988a 100644
--- a/user_guide/database/index.html
+++ b/user_guide/database/index.html
@@ -76,7 +76,7 @@ structures and Active Record patterns. The database functions offer clear, simpl
<li><a href="call_function.html">Custom Function Calls</a></li>
<li><a href="caching.html">Query Caching</a></li>
<li><a href="forge.html">Database manipulation with Database Forge</a></li>
- <li><a href="utilities.html">Database Utilities Class</a></li>
+ <li><a href="utilities.html">Database Utilities Class</a></li>
</ul>
diff --git a/user_guide/general/helpers.html b/user_guide/general/helpers.html
index 3c9f11950..ea794f08a 100644
--- a/user_guide/general/helpers.html
+++ b/user_guide/general/helpers.html
@@ -69,7 +69,7 @@ Each helper function performs one specific task, with no dependence on other fun
<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>
-<p>Helpers are typically stored in your <dfn>system/helpers</dfn>, or <dfn>system/application/helpers </dfn>directory. CodeIgniter will look first in your <dfn>system/application/helpers</dfn>
+<p>Helpers are typically stored in your <dfn>system/helpers</dfn>, or <dfn>system/application/helpers </dfn>directory. CodeIgniter will look first in your <dfn>system/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
<dfn>system/helpers</dfn> folder.</p>
diff --git a/user_guide/general/views.html b/user_guide/general/views.html
index a161fa01c..bc0861509 100644
--- a/user_guide/general/views.html
+++ b/user_guide/general/views.html
@@ -129,7 +129,7 @@ class Page extends Controller {<br /><br />
&nbsp;&nbsp;&nbsp;}<br />
<br />
}<br />
- ?&gt;</code></p>
+ ?&gt;</code></p>
<p>In the example above, we are using &quot;dynamically added data&quot;, which you will see below.</p>
<h2>Storing Views within Sub-folders</h2>
<p>Your view files can also be stored within sub-folders if you prefer that type of organization. When doing so you will need
diff --git a/user_guide/helpers/form_helper.html b/user_guide/helpers/form_helper.html
index 83b97ab15..839f7251c 100644
--- a/user_guide/helpers/form_helper.html
+++ b/user_guide/helpers/form_helper.html
@@ -258,7 +258,7 @@ echo form_fieldset_close();
&lt;/fieldset&gt;</code>
<p>Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes. </p>
<p><code>$attributes = array('id' =&gt; 'address_info', 'class' =&gt; 'address_info');<br />
- echo form_fieldset('Address Information', $attributes);<br />
+ echo form_fieldset('Address Information', $attributes);<br />
echo &quot;&lt;p&gt;fieldset content here&lt;/p&gt;\n&quot;;<br />
echo form_fieldset_close(); <br />
<br />
@@ -269,7 +269,7 @@ echo form_fieldset_close(); <br />
&lt;/fieldset&gt;</code></p>
<h2>form_fieldset_close()</h2>
<p>Produces a closing &lt;/fieldset&gt; tag. The only advantage to using this function is it permits you to pass data to it
- which will be added below the tag. For example:</p>
+ which will be added below the tag. For example:</p>
<code>$string = &quot;&lt;/div&gt;&lt;/div&gt;&quot;;<br />
<br />
echo fieldset_close($string);<br />
@@ -321,7 +321,7 @@ fourth parameter:</p>
<br />
&lt;input type=&quot;submit&quot; name=&quot;mysubmit&quot; value=&quot;Submit Post!&quot; /&gt;</code>
<p>Similar to other functions, you can submit an associative array in the first parameter if you prefer to set your own attributes.
- The third parameter lets you add extra data to your form, like JavaScript.</p>
+ The third parameter lets you add extra data to your form, like JavaScript.</p>
<h2>form_label()</h2>
<p>Lets you generate a &lt;label&gt;. Simple example:</p>
<code>echo form_label('What is your Name', 'username');<br />
@@ -329,13 +329,13 @@ fourth parameter:</p>
// Would produce:
<br />
&lt;label for=&quot;username&quot;&gt;What is your Name&lt;/label&gt;</code>
-<p>Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes. </p>
+<p>Similar to other functions, you can submit an associative array in the third parameter if you prefer to set additional attributes. </p>
<p><code>$attributes = array(<br />
&nbsp;&nbsp;&nbsp;&nbsp;'class' =&gt; 'mycustomclass',<br />
&nbsp;&nbsp;&nbsp;&nbsp;'style' =&gt; 'color: #000;',<br />
);<br />
- echo form_label('What is your Name', 'username', $attributes);<br />
- <br />
+ echo form_label('What is your Name', 'username', $attributes);<br />
+ <br />
// Would produce: <br />
&lt;label for=&quot;username&quot; class=&quot;mycustomclass&quot; style=&quot;color: #000;&quot;&gt;What is your Name&lt;/label&gt;</code></p>
<h2>form_reset()</h2>
diff --git a/user_guide/helpers/html_helper.html b/user_guide/helpers/html_helper.html
index fcbcccdf0..62898403d 100644
--- a/user_guide/helpers/html_helper.html
+++ b/user_guide/helpers/html_helper.html
@@ -80,7 +80,7 @@ second the size of the heading. Example:</p>
<p>The above would produce: &lt;h3>Welcome!&lt;/h3></p>
<h2>img()</h2>
<p>Lets you create HTML &lt;img /&gt; tags. The first parameter contains the image source. There is data, the
- second the size of the heading. Example:</p>
+ second the size of the heading. Example:</p>
<code>echo img('images/picture.jpg');<br />
// gives &lt;img src=&quot;http://site.com/images/picture.jpg&quot; /&gt;</code>
<p>There is an optional second parameter that is a TRUE/FALSE value that specifics if the src should have the page specified by $config['index_page'] added to the address it creates. Presumably, this would be if you were using a media controller.</p>
@@ -88,17 +88,17 @@ second the size of the heading. Example:</p>
// gives &lt;img src=&quot;http://site.com/index.php/images/picture.jpg&quot; /&gt;</code></p>
<p>Additionally, an associative array can be passed to the img() function for complete control over all attributes and values.</p>
<p><code> $image_properties = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'src' =&gt; 'images/picture.jpg',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'alt' =&gt; 'Me, demonstrating how to eat 4 slices of pizza at one time',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'class' =&gt; 'post_images',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'width' =&gt; '200',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'height' =&gt; '200',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' =&gt; 'That was quite a night',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rel' =&gt; 'lightbox',<br />
- );<br />
- <br />
- img($image_properties);<br />
- // &lt;img src=&quot;http://site.com/index.php/images/picture.jpg&quot; alt=&quot;Me, demonstrating how to eat 4 slices of pizza at one time&quot; class=&quot;post_images&quot; width=&quot;200&quot; height=&quot;200&quot; title=&quot;That was quite a night&quot; rel=&quot;lightbox&quot; /&gt;</code></p>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'src' =&gt; 'images/picture.jpg',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'alt' =&gt; 'Me, demonstrating how to eat 4 slices of pizza at one time',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'class' =&gt; 'post_images',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'width' =&gt; '200',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'height' =&gt; '200',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' =&gt; 'That was quite a night',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rel' =&gt; 'lightbox',<br />
+ );<br />
+ <br />
+ img($image_properties);<br />
+ // &lt;img src=&quot;http://site.com/index.php/images/picture.jpg&quot; alt=&quot;Me, demonstrating how to eat 4 slices of pizza at one time&quot; class=&quot;post_images&quot; width=&quot;200&quot; height=&quot;200&quot; title=&quot;That was quite a night&quot; rel=&quot;lightbox&quot; /&gt;</code></p>
<h2>link_tag()</h2>
<p>Lets you create HTML &lt;link /> tags. This is useful for stylesheet links, as well as other links. The parameters are href, with optional rel, type, title, media and index_page. index_page is a TRUE/FALSE value that specifics if the href should have the page specified by $config['index_page'] added to the address it creates.<code>
echo link_tag('css/mystyles.css');<br />
@@ -106,24 +106,24 @@ echo link_tag('css/mystyles.css');<br />
<p>Further examples:</p>
<code>
- echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');<br />
- // &lt;link href=&quot;http://site.com/favicon.ico&quot; rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; /&gt;
- <br />
- <br />
- echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');<br />
- // &lt;link href=&quot;http://site.com/feed&quot; rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;My RSS Feed&quot; /&gt; </code>
+ echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');<br />
+ // &lt;link href=&quot;http://site.com/favicon.ico&quot; rel=&quot;shortcut icon&quot; type=&quot;image/ico&quot; /&gt;
+ <br />
+ <br />
+ echo link('feed', 'alternate', 'application/rss+xml', 'My RSS Feed');<br />
+ // &lt;link href=&quot;http://site.com/feed&quot; rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;My RSS Feed&quot; /&gt; </code>
<p>Additionally, an associative array can be passed to the link() function for complete control over all attributes and values.</p>
<p><code>
- $link = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'href' =&gt; 'css/printer.css',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rel' =&gt; 'stylesheet',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt; 'text/css',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'media' =&gt; 'print'<br />
- );<br />
- <br />
- echo link_tag($link);<br />
- // &lt;link href=&quot;http://site.com/css/printer.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot; /&gt;</code></p>
-
+ $link = array(<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'href' =&gt; 'css/printer.css',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'rel' =&gt; 'stylesheet',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'type' =&gt; 'text/css',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'media' =&gt; 'print'<br />
+ );<br />
+ <br />
+ echo link_tag($link);<br />
+ // &lt;link href=&quot;http://site.com/css/printer.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot; /&gt;</code></p>
+
<h2>nbs()</h2>
<p>Generates non-breaking spaces (&amp;nbsp;) based on the number you submit. Example:</p>
<code>echo nbs(3);</code>
diff --git a/user_guide/helpers/string_helper.html b/user_guide/helpers/string_helper.html
index 025a4329a..24a0a661e 100644
--- a/user_guide/helpers/string_helper.html
+++ b/user_guide/helpers/string_helper.html
@@ -122,8 +122,8 @@ echo repeater($string, 30);</code>
echo reduce_double_slashes($string); // results in &quot;http://example.com/index.php&quot;</code>
<h2>trim_slashes()</h2>
<p>Removes any leading/trailing slashes from a string. Example:<br />
- <br />
- <code>$string = &quot;/this/that/theother/&quot;;<br />
+ <br />
+ <code>$string = &quot;/this/that/theother/&quot;;<br />
echo trim_slashes($string); // results in this/that/theother</code></p>
diff --git a/user_guide/installation/upgrade_154.html b/user_guide/installation/upgrade_154.html
index 90bc7d3cc..01389f338 100644
--- a/user_guide/installation/upgrade_154.html
+++ b/user_guide/installation/upgrade_154.html
@@ -80,15 +80,15 @@ Upgrading from 1.5.3 to 1.5.4
<h2>Step 2: Add charset to your config.php </h2>
<p>Add the following to system/application/config/config.php</p>
<code>/*<br />
- |--------------------------------------------------------------------------<br />
- | Default Character Set<br />
- |--------------------------------------------------------------------------<br />
- |<br />
- | This determines which character set is used by default in various methods<br />
- | that require a character set to be provided.<br />
- |<br />
- */<br />
- $config['charset'] = &quot;UTF-8&quot;;</code>
+ |--------------------------------------------------------------------------<br />
+ | Default Character Set<br />
+ |--------------------------------------------------------------------------<br />
+ |<br />
+ | This determines which character set is used by default in various methods<br />
+ | that require a character set to be provided.<br />
+ |<br />
+ */<br />
+ $config['charset'] = &quot;UTF-8&quot;;</code>
<h2>Step 3: Autoloading language files </h2>
<p>If you want to autoload any language files, add this line to system/application/config/autoload.php</p>
diff --git a/user_guide/installation/upgrade_160.html b/user_guide/installation/upgrade_160.html
index f4e703eed..b80a68816 100644
--- a/user_guide/installation/upgrade_160.html
+++ b/user_guide/installation/upgrade_160.html
@@ -83,16 +83,16 @@ Upgrading from 1.5.4 to 1.6.0
<h2>Step 3: Add $autoload['model']</h2>
<p>Add the following to system/application/autoload.php</p>
<p><code> /*<br />
- | -------------------------------------------------------------------<br />
- |  Auto-load Model files<br />
- | -------------------------------------------------------------------<br />
- | Prototype:<br />
- |<br />
- |    $autoload['model'] = array('my_model');<br />
- |<br />
- */<br />
- <br />
- $autoload['model'] = array();</code></p>
+ | -------------------------------------------------------------------<br />
+ |  Auto-load Model files<br />
+ | -------------------------------------------------------------------<br />
+ | Prototype:<br />
+ |<br />
+ |    $autoload['model'] = array('my_model');<br />
+ |<br />
+ */<br />
+ <br />
+ $autoload['model'] = array();</code></p>
<h2>Step 4: Add to your database.php </h2>
<p>Make the following changes to your system/application/config/database.php file:</p>
<p>Add the following variable above the database configuration options, with <dfn>$active_group</dfn></p>
diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html
index c8e64f824..7158ca764 100644
--- a/user_guide/libraries/sessions.html
+++ b/user_guide/libraries/sessions.html
@@ -60,35 +60,35 @@ Session Class
<p>The Session class permits you maintain a user's "state" and track their activity while they browse your site.
The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie.
-It can additionally store the session data in a database table for added security, as this permits the session ID in the
+It can also store the session data in a database table for added security, as this permits the session ID in the
user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to
-use the database option you'll need to create the session table as indicated below.
+use the database option you'll need to create the session table as indicated below.
</p>
<p class="important"><strong>Note:</strong> The Session class does <strong>not</strong> utilize native PHP sessions. It
-generates its own session data so you are not dependent on how a particular hosting environment is set up.</p>
+generates its own session data, offering more flexibility for developers.</p>
<h2>Initializing a Session</h2>
-<p>The Session routines must happen with each page load (and before anything is outputted to the browser), so the session class must either be
+<p>Sessions will typically run globally with each page load, so the session class must either be
<a href="../general/libraries.html">initialized</a> in your
<a href="../general/controllers.html">controller</a> constructors, or it can be
<a href="../general/autoloader.html">auto-loaded</a> by the system.
-Once initialized, the Session class will run unattended in the background, reading, writing, and updating the session as needed.</p>
+For the most part the session class will run unattended in the background, so simply initializing the class
+will cause it to read, create, and update sessions.</p>
<p>To initialize the Session class manually in your controller constructor, use the <dfn>$this->load->library</dfn> function:</p>
<code>$this->load->library('session');</code>
-
-<p>You can access the Session library object using: <dfn>$this->session</dfn></p>
+<p>Once loaded, the Sessions library object will be available using: <dfn>$this->session</dfn></p>
<h2>How do Sessions work?</h2>
-<p>When a page is loaded, the Session class will check to see if valid session data exists in the user's session cookie.
+<p>When a page is loaded, the session class will check to see if valid session data exists in the user's session cookie.
If sessions data does <strong>not</strong> exist (or if it has expired) a new session will be created and saved in the cookie.
-If a session <strong>does</strong> exist, its information and cookie will be updated automatically. With each update, the session_id will be regenerated for security.</p>
+If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.</p>
<p>It's important for you to understand that once initialized, the Session class runs automatically. There is nothing
you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or
@@ -141,7 +141,7 @@ will do this:</p>
<h2>Adding Custom Session Data</h2>
-<p>A useful aspect of the session array is that you can add your own data to it and it will be stored in the session array.
+<p>A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie.
Why would you want to do this? Here's one example:</p>
<p>Let's say a particular user logs into your site. Once authenticated,
@@ -156,20 +156,16 @@ having to run a database query when you need it.</p>
<p><code>$newdata = array(<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'username'&nbsp; => 'johndoe',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'email'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'johndoe@some-site.com',<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'logged_in' => TRUE<br />
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
- <br />
- $this->session->set_userdata(<samp>$newdata</samp>);</code></p>
-
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'username'&nbsp; => 'johndoe',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'email'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> 'johndoe@some-site.com',<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'logged_in' => TRUE<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
+ <br />
+ $this->session->set_userdata(<samp>$newdata</samp>);</code></p>
<p>If you want to add userdata one value at a time, set_userdata() also supports this syntax. </p>
<p><code>$this-&gt;session-&gt;set_userdata('some_name', 'some_value');</code></p>
-
-
-<p class="important"><strong>Note:</strong> By default, the session class stores your custom data in the session cookie. Cookies, however, can only hold
-4KB of data, so it is easily possible to exceed the capacity, particularly if you use encryption, since it produces a longer data string than the original.
-If you need to store a larger amount of data it is recommended that you store your session data in a database table. You'll find instructions for this below.</p>
+<p class="important"><strong>Note:</strong> Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The
+encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.</p>
<h2>Removing Session Data</h2>
<p>Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information: </p>
@@ -194,12 +190,8 @@ unless you store session data in a database there is no way to validate it. For
security, session ID validation may not be needed, but if your application requires security, validation is mandatory.</p>
<p>When session data is available in a database, every time a valid session is found in the user's cookie, a database
-query is performed to match it. If the session ID does not match, the session is destroyed.</p>
-
-<p>An additional benefit of using a database is that it permits you to store custom data along with the session. Earlier in this page we described how to add
-custom data to your session. When you use the database feature, your custom data will be stored automatically in the database <strong>instead</strong> of in
-the user's cookie.</p>
-
+query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never
+be updated, they can only be generated when a new session is created.</p>
<p>In order to store sessions, you must first create a database table for this purpose. Here is the basic
prototype (for MySQL) required by the session class:</p>
@@ -210,15 +202,12 @@ session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(50) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
-user_data text NOT NULL,
PRIMARY KEY (session_id)
);</textarea>
-<p><strong>Note:</strong> By default the table is named <dfn>ci_sessions</dfn>, but you can name it anything you want
-as long as you update the <kbd>application/config/config.php</kbd> file so that it contains the name you have chosen. The Session class, however,
-expects the column names to be identical to the ones indicated above.</p>
-
-<p>Once you have created your database table you can enable the database option in your config.php file as follows:</p>
+<p><strong>Note:</strong> By default the table is called <dfn>ci_sessions</dfn>, but you can name it anything you want
+as long as you update the <kbd>application/config/config.php</kbd> file so that it contains the name you have chosen.
+Once you have created your database table you can enable the database option in your config.php file as follows:</p>
<code>$config['sess_use_database'] = TRUE;</code>
@@ -228,7 +217,7 @@ expects the column names to be identical to the ones indicated above.</p>
<code>$config['sess_table_name'] = 'ci_sessions";</code>
-<p class="important"><strong>Note:</strong> The Session class has a built-in garbage collection routine which clears out expired sessions periodically so you
+<p class="important"><strong>Note:</strong> The Session class has built-in garbage collection which clears out expired sessions so you
do not need to write your own routine to do it.</p>
@@ -240,84 +229,64 @@ do not need to write your own routine to do it.</p>
<h2>Session Preferences</h2>
-<p>Normally you will set the Session preferences in your <kbd>application/config/config.php</kbd> file.</p>
-
-<p>If you prefer to set any of the preferences manually you can do so when you load the session class, by passing an array of values you
-wish to set in the second parameter as follows:</p>
-
-<code>
-$session_vals = array(<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'sess_expiration' = 10800,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'sess_match_ip' &nbsp;&nbsp;= TRUE<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
-<br />
-$this->load->library('session', $session_vals);
-</code>
-
-<p>The following table lists the available preferences:</p>
+<p>You'll find the following Session related preferences in your <kbd>application/config/config.php</kbd> file:</p>
<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
<tr>
- <th>Preference</th>
- <th>Default</th>
- <th>Options</th>
- <th>Description</th>
-</tr>
-<tr>
- <td class="td"><strong>sess_cookie_name</strong></td>
- <td class="td">ci_session</td>
- <td class="td">None</td>
- <td class="td">The name you want the session cookie saved as.</td>
+ <th>Preference</th>
+ <th>Default</th>
+ <th>Options</th>
+ <th>Description</th>
</tr>
<tr>
- <td class="td"><strong>sess_expiration</strong></td>
- <td class="td">7200</td>
- <td class="td">None</td>
- <td class="td">The number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0</td>
+ <td class="td"><strong>sess_cookie_name</strong></td>
+ <td class="td">ci_session</td>
+ <td class="td">None</td>
+ <td class="td">The name you want the session cookie saved as.</td>
</tr>
<tr>
- <td class="td"><strong>sess_encrypt_cookie</strong></td>
- <td class="td">FALSE</td>
- <td class="td">TRUE/FALSE (boolean)</td>
- <td class="td">Whether to encrypt the session data.</td>
+ <td class="td"><strong>sess_expiration</strong></td>
+ <td class="td">7200</td>
+ <td class="td">None</td>
+ <td class="td">The number of seconds you would like the session to last. The default value is 2 hours (7200 seconds). If you would like a non-expiring session set the value to zero: 0</td>
</tr>
<tr>
- <td class="td"><strong>sess_use_database</strong></td>
- <td class="td">FALSE</td>
- <td class="td">TRUE/FALSE (boolean)</td>
- <td class="td">Whether to save the session data to a database. You must create the table before enabling this option.</td>
+ <td class="td"><strong>sess_encrypt_cookie</strong></td>
+ <td class="td">FALSE</td>
+ <td class="td">TRUE/FALSE (boolean)</td>
+ <td class="td">Whether to encrypt the session data.</td>
</tr>
<tr>
- <td class="td"><strong>sess_table_name</strong></td>
- <td class="td">ci_sessions</td>
- <td class="td">Any valid SQL table name</td>
- <td class="td">The name of the session database table.</td>
+ <td class="td"><strong>sess_use_database</strong></td>
+ <td class="td">FALSE</td>
+ <td class="td">TRUE/FALSE (boolean)</td>
+ <td class="td">Whether to save the session data to a database. You must create the table before enabling this option.</td>
</tr>
<tr>
- <td class="td"><strong>sess_time_to_update</strong></td>
- <td class="td">300</td>
- <td class="td">Time in seconds</td>
- <td class="td">This options controls how often the session class will regenerate itself and create a new session id.</td>
+ <td class="td"><strong>sess_table_name</strong></td>
+ <td class="td">ci_sessions</td>
+ <td class="td">Any valid SQL table name</td>
+ <td class="td">The name of the session database table.</td>
</tr>
<tr>
- <td class="td"><strong>sess_match_ip</strong></td>
- <td class="td">FALSE</td>
- <td class="td">TRUE/FALSE (boolean)</td>
- <td class="td">Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically
- changes the IP, so if you want a non-expiring session you will likely set this to FALSE.</td>
+ <td class="td"><strong>sess_time_to_update</strong></td>
+ <td class="td">300</td>
+ <td class="td">Time in seconds</td>
+ <td class="td">This options controls how often the session class will regenerate itself and create a new session id.</td>
</tr>
<tr>
- <td class="td"><strong>sess_match_useragent</strong></td>
- <td class="td">TRUE</td>
- <td class="td">TRUE/FALSE (boolean)</td>
- <td class="td">Whether to match the User Agent when reading the session data.</td>
+ <td class="td"><strong>sess_match_ip</strong></td>
+ <td class="td">FALSE</td>
+ <td class="td">TRUE/FALSE (boolean)</td>
+ <td class="td">Whether to match the user's IP address when reading the session data. Note that some ISPs dynamically
+ changes the IP, so if you want a non-expiring session you will likely set this to FALSE.</td>
</tr>
<tr>
- <td class="td"><strong>sess_cookie_name</strong></td>
- <td class="td">ci_session</td>
- <td class="td">None</td>
- <td class="td">The name of the session cookie</td>
+ <td class="td"><strong>sess_match_useragent</strong></td>
+ <td class="td">TRUE</td>
+ <td class="td">TRUE/FALSE (boolean)</td>
+ <td class="td">Whether to match the User Agent when reading the session data.</td>
</tr>
</table>
diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html
index 8b36e09ba..55443060c 100644
--- a/user_guide/libraries/validation.html
+++ b/user_guide/libraries/validation.html
@@ -576,64 +576,43 @@ For example, your "username" error will be available at:<br /><dfn>$this->valida
<td class="td">Returns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes.</td>
<td class="td">&nbsp;</td>
</tr>
-
<tr>
-<td class="td"><strong>numeric</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than numeric characters.</td>
-<td class="td">&nbsp;</td>
+ <td class="td"><strong>numeric</strong></td>
+ <td class="td">No</td>
+ <td class="td">Returns FALSE if the form element contains anything other than numeric characters.</td>
+ <td class="td">&nbsp;</td>
</tr>
-
<tr>
+
<td class="td"><strong>integer</strong></td>
<td class="td">No</td>
<td class="td">Returns FALSE if the form element contains anything other than an integer.</td>
<td class="td">&nbsp;</td>
-</tr>
-
-<tr>
-<td class="td"><strong>is_natural</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than a natural number: 0, 1, 2, 3, etc.</td>
-<td class="td">&nbsp;</td>
-</tr>
-
-<tr>
-<td class="td"><strong>is_natural_no_zero</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc.</td>
-<td class="td">&nbsp;</td>
-</tr>
+</tr><tr>
-<tr>
<td class="td"><strong>valid_email</strong></td>
<td class="td">No</td>
<td class="td">Returns FALSE if the form element does not contain a valid email address.</td>
<td class="td">&nbsp;</td>
</tr>
-
<tr>
-<td class="td"><strong>valid_emails</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if any value provided in a comma separated list is not a valid email.</td>
-<td class="td">&nbsp;</td>
+ <td class="td"><strong>valid_emails</strong></td>
+ <td class="td">No</td>
+ <td class="td">Returns FALSE if any value provided in a comma separated list is not a valid email.</td>
+ <td class="td">&nbsp;</td>
</tr>
-
<tr>
<td class="td"><strong>valid_ip</strong></td>
<td class="td">No</td>
<td class="td">Returns FALSE if the supplied IP is not valid.</td>
<td class="td">&nbsp;</td>
</tr>
-
<tr>
-<td class="td"><strong>valid_base64</strong></td>
-<td class="td">No</td>
-<td class="td">Returns FALSE if the supplied string contains anything other than valid Base64 characters.</td>
-<td class="td">&nbsp;</td>
+ <td class="td"><strong>valid_base64</strong></td>
+ <td class="td">No</td>
+ <td class="td">Returns FALSE if the supplied string contains anything other than valid Base64 characters.</td>
+ <td class="td">&nbsp;</td>
</tr>
-
-
</table>
<p><strong>Note:</strong> These rules can also be called as discrete functions. For example:</p>