summaryrefslogtreecommitdiffstats
path: root/user_guide/libraries
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-01-16 22:10:09 +0100
committerDerek Allard <derek.allard@ellislab.com>2008-01-16 22:10:09 +0100
commit39b622db9bda38282a32bb45623da63efe685729 (patch)
tree0d1a1729dc544ebfd1d3dfb11b2ff78759bcf7be /user_guide/libraries
parentf4615fec22671262e95d3a852f8b9088314118f2 (diff)
Many new Active Record functions, and another whack of stuff
Diffstat (limited to 'user_guide/libraries')
-rw-r--r--user_guide/libraries/benchmark.html2
-rw-r--r--user_guide/libraries/calendar.html2
-rw-r--r--user_guide/libraries/config.html2
-rw-r--r--user_guide/libraries/email.html300
-rw-r--r--user_guide/libraries/encryption.html2
-rw-r--r--user_guide/libraries/file_uploading.html2
-rw-r--r--user_guide/libraries/ftp.html2
-rw-r--r--user_guide/libraries/image_lib.html2
-rw-r--r--user_guide/libraries/input.html2
-rw-r--r--user_guide/libraries/language.html2
-rw-r--r--user_guide/libraries/loader.html2
-rw-r--r--user_guide/libraries/output.html2
-rw-r--r--user_guide/libraries/pagination.html2
-rw-r--r--user_guide/libraries/parser.html2
-rw-r--r--user_guide/libraries/table.html293
-rw-r--r--user_guide/libraries/trackback.html2
-rw-r--r--user_guide/libraries/unit_testing.html2
-rw-r--r--user_guide/libraries/uri.html253
-rw-r--r--user_guide/libraries/user_agent.html202
-rw-r--r--user_guide/libraries/validation.html2
-rw-r--r--user_guide/libraries/xmlrpc.html488
-rw-r--r--user_guide/libraries/zip.html2
22 files changed, 1548 insertions, 22 deletions
diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html
index f17554e0c..af83f8e57 100644
--- a/user_guide/libraries/benchmark.html
+++ b/user_guide/libraries/benchmark.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html
index ae6c571ae..698df01cf 100644
--- a/user_guide/libraries/calendar.html
+++ b/user_guide/libraries/calendar.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html
index 3eec0a028..67352adca 100644
--- a/user_guide/libraries/config.html
+++ b/user_guide/libraries/config.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html
index 527c34a4e..c59374ca9 100644
--- a/user_guide/libraries/email.html
+++ b/user_guide/libraries/email.html
@@ -1 +1,299 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>CodeIgniter User Guide : Email Class</title> <style type='text/css' media='all'>@import url('../userguide.css');</style> <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' /> <script type="text/javascript" src="../nav/nav.js"></script> <script type="text/javascript" src="../nav/prototype.lite.js"></script> <script type="text/javascript" src="../nav/moo.fx.js"></script> <script type="text/javascript" src="../nav/user_guide_menu.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv='expires' content='-1' /> <meta http-equiv= 'pragma' content='no-cache' /> <meta name='robots' content='all' /> <meta name='author' content='Rick Ellis' /> <meta name='description' content='CodeIgniter User Guide' /> </head> <body> <!-- START NAVIGATION --> <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div> <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div> <div id="masthead"> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td><h1>CodeIgniter User Guide Version 1.5.4</h1></td> <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td> </tr> </table> </div> <!-- END NAVIGATION --> <!-- START BREADCRUMB --> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td id="breadcrumb"> <a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp; <a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp; Email Class </td> <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td> </tr> </table> <!-- END BREADCRUMB --> <br clear="all" /> <!-- START CONTENT --> <div id="content"> <h1>Email Class</h1> <p>CodeIgniter's robust Email Class supports the following features:</p> <ul> <li>Multiple Protocols: Mail, Sendmail, and SMTP</li> <li>Multiple recipients</li> <li>CC and BCCs</li> <li>HTML or Plaintext email</li> <li>Attachments</li> <li>Word wrapping</li> <li>Priorities</li> <li>BCC Batch Mode, enabling large email lists to be broken into small BCC batches.</li> <li>Email Debugging tools</li> </ul> <h2>Sending Email</h2> <p>Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.</p> <p>Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your <a href="../general/controllers.html">controllers</a>.</p> <code>$this->load->library('email');<br /> <br /> $this->email->from('your@your-site.com', 'Your Name');<br /> $this->email->to('someone@example.com'); <br /> $this->email->cc('another@another-example.com'); <br /> $this->email->bcc('them@their-example.com'); <br /> <br /> $this->email->subject('Email Test');<br /> $this->email->message('Testing the email class.'); <br /> <br /> $this->email->send();<br /> <br /> echo $this->email->print_debugger();</code> <h2>Setting Email Preferences</h2> <p>There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually as described here, or automatically via preferences stored in your config file, described below:</p> <p>Preferences are set by passing an array of preference values to the email <dfn>initialize</dfn> function. Here is an example of how you might set some preferences:</p> <code>$config['protocol'] = 'sendmail';<br /> $config['mailpath'] = '/usr/sbin/sendmail';<br /> $config['charset'] = 'iso-8859-1';<br /> $config['wordwrap'] = TRUE;<br /> <br /> $this->email->initialize($config);</code> <p><strong>Note:</strong> Most of the preferences have default values that will be used if you do not set them.</p ><h3>Setting Email Preferences in a Config File</h3> <p>If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called the <var>email.php</var>, add the <var>$config</var> array in that file. Then save the file at <var>config/email.php</var> and it will be used automatically. You will NOT need to use the <dfn>$this->email->initialize()</dfn> function if you save your preferences in a config file.</p> <h2>Email Preferences</h2> <p>The following is a list of all the preferences that can be set when sending email.</p> <table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder"> <tr> <th>Preference</th> <th>Default&nbsp;Value</th> <th>Options</th> <th>Description</th> </tr><tr> <td class="td"><strong>useragent</strong></td><td class="td">CodeIgniter</td><td class="td">None</td><td class="td">The "user agent".</td> </tr><tr> <td class="td"><strong>protocol</strong></td><td class="td">mail</td><td class="td">mail, sendmail, or smtp</td><td class="td">The mail sending protocol.</td> </tr><tr> <td class="td"><strong>mailpath</strong></td><td class="td">/usr/sbin/sendmail</td><td class="td">None</td><td class="td">The server path to Sendmail.</td> </tr><tr> <td class="td"><strong>smtp_host</strong></td><td class="td">No Default</td><td class="td">None</td><td class="td">SMTP Server Address.</td> </tr><tr> <td class="td"><strong>smtp_user</strong></td><td class="td">No Default</td><td class="td">None</td><td class="td">SMTP Username.</td> </tr><tr> <td class="td"><strong>smtp_pass</strong></td><td class="td">No Default</td><td class="td">None</td><td class="td">SMTP Password.</td> </tr><tr> <td class="td"><strong>smtp_port</strong></td><td class="td">25</td><td class="td">None</td><td class="td">SMTP Port.</td> </tr><tr> <td class="td"><strong>smtp_timeout</strong></td><td class="td">5</td><td class="td">None</td><td class="td">SMTP Timeout (in seconds).</td> </tr><tr> <td class="td"><strong>wordwrap</strong></td><td class="td">TRUE</td><td class="td">TRUE or FALSE (boolean)</td><td class="td">Enable word-wrap.</td> </tr><tr> <td class="td"><strong>wrapchars</strong></td><td class="td">76</td><td class="td"> </td><td class="td">Character count to wrap at.</td> </tr><tr> <td class="td"><strong>mailtype</strong></td><td class="td">text</td><td class="td">text or html</td><td class="td">Type of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.</td> </tr><tr> <td class="td"><strong>charset</strong></td><td class="td">utf-8</td><td class="td"></td><td class="td">Character set (utf-8, iso-8859-1, etc.).</td> </tr><tr> <td class="td"><strong>validate</strong></td><td class="td">FALSE</td><td class="td">TRUE or FALSE (boolean)</td><td class="td">Whether to validate the email address.</td> </tr><tr> <td class="td"><strong>priority</strong></td><td class="td">3</td><td class="td">1, 2, 3, 4, 5</td><td class="td">Email Priority. 1 = highest. 5 = lowest. 3 = normal.</td> </tr><tr> <td class="td"><strong>newline</strong></td><td class="td">\n</td><td class="td">"\r\n" or "\n"</td><td class="td">Newline character. (Use "\r\n" to comply with RFC 822).</td> </tr><tr> <td class="td"><strong>bcc_batch_mode</strong></td><td class="td">FALSE</td><td class="td">TRUE or FALSE (boolean)</td><td class="td">Enable BCC Batch Mode.</td> </tr><tr> <td class="td"><strong>bcc_batch_size</strong></td><td class="td">200</td><td class="td">None</td><td class="td">Number of emails in each BCC batch.</td> </tr> </table> <h2>Email Function Reference</h2> <h3>$this->email->from()</h3> <p>Sets the email address and name of the person sending the email:</p> <code>$this->email->from('<var>you@your-site.com</var>', '<var>Your Name</var>');</code> <h3>$this->email->reply_to()</h3> <p>Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:</p> <code>$this->email->reply_to('<var>you@your-site.com</var>', '<var>Your Name</var>');</code> <h3>$this->email->to()</h3> <p>Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:</p> <code>$this->email->to('<var>someone@example.com</var>');</code> <code>$this->email->to('<var>one@example.com</var>, <var>two@example.com</var>, <var>three@example.com</var>');</code> <code>$list = array('<var>one@example.com</var>', '<var>two@example.com</var>', '<var>three@example.com</var>');<br /> <br /> $this->email->to(<var>$list</var>);</code> <h3>$this->email->cc()</h3> <p>Sets the CC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.</p> <h3>$this->email->bcc()</h3> <p>Sets the BCC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.</p> <h3>$this->email->subject()</h3> <p>Sets the email subject:</p> <code>$this->email->subject('<var>This is my subject</var>');</code> <h3>$this->email->message()</h3> <p>Sets the email message body:</p> <code>$this->email->message('<var>This is my message</var>');</code> <h3>$this->email->set_alt_message()</h3> <p>Sets the alternative email message body:</p> <code>$this->email->set_alt_message('<var>This is the alternative message</var>');</code> <p>This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative message with no HTML formatting which is added to the header string for people who do not accept HTML email. If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.</p> <h3>$this->email->clear()</h3> <p>Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function in a loop, permitting the data to be reset between cycles.</p> <code>foreach ($list as $name => $address)<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;$this->email->clear();<br /><br /> &nbsp;&nbsp;&nbsp;&nbsp;$this->email->to($address);<br /> &nbsp;&nbsp;&nbsp;&nbsp;$this->email->from('your@your-site.com');<br /> &nbsp;&nbsp;&nbsp;&nbsp;$this->email->subject('Here is your info '.$name);<br /> &nbsp;&nbsp;&nbsp;&nbsp;$this->email->message('Hi '.$name.' Here is the info you requested.');<br /> &nbsp;&nbsp;&nbsp;&nbsp;$this->email->send();<br /> }</code> <p>If you set the parameter to TRUE any attachments will be cleared as well:</p> <code>$this->email->clear(TRUE);</code> <h3>$this->email->send()</h3> <p>The Email sending function. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used conditionally:</p> <code>if ( ! $this->email->send())<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;// Generate error<br /> }</code> <h3>$this->email->attach()</h3> <p>Enables you to send an attachment. Put the file path/name in the first parameter. Note: Use a file path, not a URL. For multiple attachments use the function multiple times. For example:</p> <code>$this->email->attach('/path/to/photo1.jpg');<br /> $this->email->attach('/path/to/photo2.jpg');<br /> $this->email->attach('/path/to/photo3.jpg');<br /> <br /> $this->email->send();</code> <h3>$this->email->print_debugger()</h3> <p>Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.</p> <h2>Overriding Word Wrapping</h2> <p>If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override word wrapping within part of your message like this:</p> <code>The text of your email that<br /> gets wrapped normally.<br /> <br /> <var>{unwrap}</var>http://www.example.com/a_long_link_that_should_not_be_wrapped.html<var>{/unwrap}</var><br /> <br /> More text that will be<br /> wrapped normally.</code> <p>Place the item you do not want word-wrapped between: <var>{unwrap}</var> <var>{/unwrap}</var></p> </div> <!-- END CONTENT --> <div id="footer"> <p> Previous Topic:&nbsp;&nbsp;<a href="database/index.html">Database Class</a> &nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; Next Topic:&nbsp;&nbsp;<a href="encryption.html">Encryption Class</a> </p> <p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p> </div> </body> </html> \ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+
+<title>CodeIgniter User Guide : Email Class</title>
+
+<style type='text/css' media='all'>@import url('../userguide.css');</style>
+<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
+
+<script type="text/javascript" src="../nav/nav.js"></script>
+<script type="text/javascript" src="../nav/prototype.lite.js"></script>
+<script type="text/javascript" src="../nav/moo.fx.js"></script>
+<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv='expires' content='-1' />
+<meta http-equiv= 'pragma' content='no-cache' />
+<meta name='robots' content='all' />
+<meta name='author' content='Rick Ellis' />
+<meta name='description' content='CodeIgniter User Guide' />
+
+</head>
+<body>
+
+<!-- START NAVIGATION -->
+<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
+<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
+<div id="masthead">
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
+<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
+</tr>
+</table>
+</div>
+<!-- END NAVIGATION -->
+
+
+<!-- START BREADCRUMB -->
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td id="breadcrumb">
+<a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
+<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
+Email Class
+</td>
+<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
+</tr>
+</table>
+<!-- END BREADCRUMB -->
+
+<br clear="all" />
+
+
+<!-- START CONTENT -->
+<div id="content">
+
+
+<h1>Email Class</h1>
+
+<p>CodeIgniter's robust Email Class supports the following features:</p>
+
+
+<ul>
+<li>Multiple Protocols: Mail, Sendmail, and SMTP</li>
+<li>Multiple recipients</li>
+<li>CC and BCCs</li>
+<li>HTML or Plaintext email</li>
+<li>Attachments</li>
+<li>Word wrapping</li>
+<li>Priorities</li>
+<li>BCC Batch Mode, enabling large email lists to be broken into small BCC batches.</li>
+<li>Email Debugging tools</li>
+</ul>
+
+
+<h2>Sending Email</h2>
+
+<p>Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.</p>
+
+<p>Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your
+<a href="../general/controllers.html">controllers</a>.</p>
+
+<code>$this->load->library('email');<br />
+<br />
+$this->email->from('your@your-site.com', 'Your Name');<br />
+$this->email->to('someone@example.com'); <br />
+$this->email->cc('another@another-example.com'); <br />
+$this->email->bcc('them@their-example.com'); <br />
+<br />
+$this->email->subject('Email Test');<br />
+$this->email->message('Testing the email class.'); <br />
+<br />
+$this->email->send();<br />
+<br />
+echo $this->email->print_debugger();</code>
+
+
+
+
+<h2>Setting Email Preferences</h2>
+
+<p>There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually
+as described here, or automatically via preferences stored in your config file, described below:</p>
+
+<p>Preferences are set by passing an array of preference values to the email <dfn>initialize</dfn> function. Here is an example of how you might set some preferences:</p>
+
+<code>$config['protocol'] = 'sendmail';<br />
+$config['mailpath'] = '/usr/sbin/sendmail';<br />
+$config['charset'] = 'iso-8859-1';<br />
+$config['wordwrap'] = TRUE;<br />
+<br />
+$this->email->initialize($config);</code>
+
+<p><strong>Note:</strong> Most of the preferences have default values that will be used if you do not set them.</p
+
+><h3>Setting Email Preferences in a Config File</h3>
+
+<p>If you prefer not to set preferences using the above method, you can instead put them into a config file.
+Simply create a new file called the <var>email.php</var>, add the <var>$config</var>
+array in that file. Then save the file at <var>config/email.php</var> and it will be used automatically. You
+will NOT need to use the <dfn>$this->email->initialize()</dfn> function if you save your preferences in a config file.</p>
+
+
+
+
+<h2>Email Preferences</h2>
+
+<p>The following is a list of all the preferences that can be set when sending email.</p>
+
+
+<table cellpadding="0" cellspacing="1" border="0" style="width:100%" class="tableborder">
+<tr>
+<th>Preference</th>
+<th>Default&nbsp;Value</th>
+<th>Options</th>
+<th>Description</th>
+</tr><tr>
+<td class="td"><strong>useragent</strong></td><td class="td">CodeIgniter</td><td class="td">None</td><td class="td">The "user agent".</td>
+</tr><tr>
+<td class="td"><strong>protocol</strong></td><td class="td">mail</td><td class="td">mail, sendmail, or smtp</td><td class="td">The mail sending protocol.</td>
+</tr><tr>
+<td class="td"><strong>mailpath</strong></td><td class="td">/usr/sbin/sendmail</td><td class="td">None</td><td class="td">The server path to Sendmail.</td>
+</tr><tr>
+<td class="td"><strong>smtp_host</strong></td><td class="td">No Default</td><td class="td">None</td><td class="td">SMTP Server Address.</td>
+</tr><tr>
+<td class="td"><strong>smtp_user</strong></td><td class="td">No Default</td><td class="td">None</td><td class="td">SMTP Username.</td>
+</tr><tr>
+<td class="td"><strong>smtp_pass</strong></td><td class="td">No Default</td><td class="td">None</td><td class="td">SMTP Password.</td>
+</tr><tr>
+<td class="td"><strong>smtp_port</strong></td><td class="td">25</td><td class="td">None</td><td class="td">SMTP Port.</td>
+</tr><tr>
+<td class="td"><strong>smtp_timeout</strong></td><td class="td">5</td><td class="td">None</td><td class="td">SMTP Timeout (in seconds).</td>
+</tr><tr>
+<td class="td"><strong>wordwrap</strong></td><td class="td">TRUE</td><td class="td">TRUE or FALSE (boolean)</td><td class="td">Enable word-wrap.</td>
+</tr><tr>
+<td class="td"><strong>wrapchars</strong></td><td class="td">76</td><td class="td"> </td><td class="td">Character count to wrap at.</td>
+</tr><tr>
+<td class="td"><strong>mailtype</strong></td><td class="td">text</td><td class="td">text or html</td><td class="td">Type of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.</td>
+</tr><tr>
+<td class="td"><strong>charset</strong></td><td class="td">utf-8</td><td class="td"></td><td class="td">Character set (utf-8, iso-8859-1, etc.).</td>
+</tr><tr>
+<td class="td"><strong>validate</strong></td><td class="td">FALSE</td><td class="td">TRUE or FALSE (boolean)</td><td class="td">Whether to validate the email address.</td>
+</tr><tr>
+<td class="td"><strong>priority</strong></td><td class="td">3</td><td class="td">1, 2, 3, 4, 5</td><td class="td">Email Priority. 1 = highest. 5 = lowest. 3 = normal.</td>
+</tr><tr>
+<td class="td"><strong>newline</strong></td><td class="td">\n</td><td class="td">"\r\n" or "\n"</td><td class="td">Newline character. (Use "\r\n" to comply with RFC 822).</td>
+</tr><tr>
+<td class="td"><strong>bcc_batch_mode</strong></td><td class="td">FALSE</td><td class="td">TRUE or FALSE (boolean)</td><td class="td">Enable BCC Batch Mode.</td>
+</tr><tr>
+<td class="td"><strong>bcc_batch_size</strong></td><td class="td">200</td><td class="td">None</td><td class="td">Number of emails in each BCC batch.</td>
+</tr>
+</table>
+
+
+<h2>Email Function Reference</h2>
+
+<h3>$this->email->from()</h3>
+<p>Sets the email address and name of the person sending the email:</p>
+<code>$this->email->from('<var>you@your-site.com</var>', '<var>Your Name</var>');</code>
+
+<h3>$this->email->reply_to()</h3>
+<p>Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:</p>
+<code>$this->email->reply_to('<var>you@your-site.com</var>', '<var>Your Name</var>');</code>
+
+
+<h3>$this->email->to()</h3>
+<p>Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:</p>
+
+<code>$this->email->to('<var>someone@example.com</var>');</code>
+<code>$this->email->to('<var>one@example.com</var>, <var>two@example.com</var>, <var>three@example.com</var>');</code>
+
+<code>$list = array('<var>one@example.com</var>', '<var>two@example.com</var>', '<var>three@example.com</var>');<br />
+<br />
+$this->email->to(<var>$list</var>);</code>
+
+<h3>$this->email->cc()</h3>
+<p>Sets the CC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.</p>
+
+<h3>$this->email->bcc()</h3>
+<p>Sets the BCC email address(s). Just like the "to", can be a single email, a comma-delimited list or an array.</p>
+
+
+<h3>$this->email->subject()</h3>
+<p>Sets the email subject:</p>
+<code>$this->email->subject('<var>This is my subject</var>');</code>
+
+<h3>$this->email->message()</h3>
+<p>Sets the email message body:</p>
+<code>$this->email->message('<var>This is my message</var>');</code>
+
+<h3>$this->email->set_alt_message()</h3>
+<p>Sets the alternative email message body:</p>
+<code>$this->email->set_alt_message('<var>This is the alternative message</var>');</code>
+
+<p>This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative
+message with no HTML formatting which is added to the header string for people who do not accept HTML email.
+If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.</p>
+
+
+
+<h3>$this->email->clear()</h3>
+<p>Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function
+in a loop, permitting the data to be reset between cycles.</p>
+<code>foreach ($list as $name => $address)<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$this->email->clear();<br /><br />
+
+&nbsp;&nbsp;&nbsp;&nbsp;$this->email->to($address);<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$this->email->from('your@your-site.com');<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$this->email->subject('Here is your info '.$name);<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$this->email->message('Hi '.$name.' Here is the info you requested.');<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$this->email->send();<br />
+}</code>
+
+<p>If you set the parameter to TRUE any attachments will be cleared as well:</p>
+
+<code>$this->email->clear(TRUE);</code>
+
+
+<h3>$this->email->send()</h3>
+<p>The Email sending function. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used
+conditionally:</p>
+
+<code>if ( ! $this->email->send())<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;// Generate error<br />
+}</code>
+
+
+<h3>$this->email->attach()</h3>
+<p>Enables you to send an attachment. Put the file path/name in the first parameter. Note: Use a file path, not a URL.
+For multiple attachments use the function multiple times. For example:</p>
+
+<code>$this->email->attach('/path/to/photo1.jpg');<br />
+$this->email->attach('/path/to/photo2.jpg');<br />
+$this->email->attach('/path/to/photo3.jpg');<br />
+<br />
+$this->email->send();</code>
+
+
+<h3>$this->email->print_debugger()</h3>
+<p>Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.</p>
+
+
+<h2>Overriding Word Wrapping</h2>
+
+<p>If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can
+get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override
+word wrapping within part of your message like this:</p>
+
+<code>The text of your email that<br />
+gets wrapped normally.<br />
+<br />
+<var>{unwrap}</var>http://www.example.com/a_long_link_that_should_not_be_wrapped.html<var>{/unwrap}</var><br />
+<br />
+More text that will be<br />
+wrapped normally.</code>
+
+<p>Place the item you do not want word-wrapped between: <var>{unwrap}</var> <var>{/unwrap}</var></p>
+
+
+</div>
+<!-- END CONTENT -->
+
+
+<div id="footer">
+<p>
+Previous Topic:&nbsp;&nbsp;<a href="database/index.html">Database Class</a>
+&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+Next Topic:&nbsp;&nbsp;<a href="encryption.html">Encryption Class</a>
+</p>
+<p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
+</div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html
index ab6195cb1..f3b3d4406 100644
--- a/user_guide/libraries/encryption.html
+++ b/user_guide/libraries/encryption.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html
index 86ee0cc85..46865acad 100644
--- a/user_guide/libraries/file_uploading.html
+++ b/user_guide/libraries/file_uploading.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html
index b88b640ac..585811966 100644
--- a/user_guide/libraries/ftp.html
+++ b/user_guide/libraries/ftp.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html
index 83dc8b3c0..39c1bd27f 100644
--- a/user_guide/libraries/image_lib.html
+++ b/user_guide/libraries/image_lib.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html
index de623c07b..2bca88aed 100644
--- a/user_guide/libraries/input.html
+++ b/user_guide/libraries/input.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html
index 7883e2a04..3ee62008d 100644
--- a/user_guide/libraries/language.html
+++ b/user_guide/libraries/language.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html
index 7ff597c64..6aec87c13 100644
--- a/user_guide/libraries/loader.html
+++ b/user_guide/libraries/loader.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html
index 27a458a87..2d131956e 100644
--- a/user_guide/libraries/output.html
+++ b/user_guide/libraries/output.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html
index d18d364f2..e05a6e887 100644
--- a/user_guide/libraries/pagination.html
+++ b/user_guide/libraries/pagination.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html
index a5271dea9..dab6937e2 100644
--- a/user_guide/libraries/parser.html
+++ b/user_guide/libraries/parser.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html
index 0e627d120..93eb38ddb 100644
--- a/user_guide/libraries/table.html
+++ b/user_guide/libraries/table.html
@@ -1 +1,292 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>CodeIgniter User Guide : HTML Table Class</title> <style type='text/css' media='all'>@import url('../userguide.css');</style> <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' /> <script type="text/javascript" src="../nav/nav.js"></script> <script type="text/javascript" src="../nav/prototype.lite.js"></script> <script type="text/javascript" src="../nav/moo.fx.js"></script> <script type="text/javascript" src="../nav/user_guide_menu.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv='expires' content='-1' /> <meta http-equiv= 'pragma' content='no-cache' /> <meta name='robots' content='all' /> <meta name='author' content='Rick Ellis' /> <meta name='description' content='CodeIgniter User Guide' /> </head> <body> <!-- START NAVIGATION --> <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div> <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div> <div id="masthead"> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td><h1>CodeIgniter User Guide Version 1.5.4</h1></td> <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td> </tr> </table> </div> <!-- END NAVIGATION --> <!-- START BREADCRUMB --> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td id="breadcrumb"> <a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp; <a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp; HTML Table Class </td> <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td> </tr> </table> <!-- END BREADCRUMB --> <br clear="all" /> <!-- START CONTENT --> <div id="content"> <h1>HTML Table Class</h1> <p>The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.</p> <h2>Initializing the Class</h2> <p>Like most other classes in CodeIgniter, the Table class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p> <code>$this->load->library('table');</code> <p>Once loaded, the Table library object will be available using: <dfn>$this->table</dfn></p> <h2>Examples</h2> <p>Here is an example showing how you can create a table from a multi-dimensional array. Note that the first array index will become the table heading (or you can set your own headings using the <dfn>set_heading()</dfn> function described in the function reference below).</p> <code> $this->load->library('table');<br /> <br /> $data = array(<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Name', 'Color', 'Size'),<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Fred', 'Blue', 'Small'),<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Mary', 'Red', 'Large'),<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('John', 'Green', 'Medium') <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br /> <br /> echo $this->table->generate($data); </code> <p>Here is an example of a table created from a database query result. The table class will automatically generate the headings based on the table names (or you can set your own headings using the <dfn>set_heading()</dfn> function described in the function reference below).</p> <code> $this->load->library('table');<br /> <br /> $query = $this->db->query("SELECT * FROM my_table");<br /> <br /> echo $this->table->generate($query); </code> <p>Here is an example showing how you might create a table using discreet parameters:</p> <code> $this->load->library('table');<br /> <br /> $this->table->set_heading('Name', 'Color', 'Size');<br /> <br /> $this->table->add_row('Fred', 'Blue', 'Small');<br /> $this->table->add_row('Mary', 'Red', 'Large');<br /> $this->table->add_row('John', 'Green', 'Medium');<br /> <br /> echo $this->table->generate(); </code> <p>Here is the same example, except instead of individual parameters, arrays are used:</p> <code> $this->load->library('table');<br /> <br /> $this->table->set_heading(array('Name', 'Color', 'Size'));<br /> <br /> $this->table->add_row(array('Fred', 'Blue', 'Small'));<br /> $this->table->add_row(array('Mary', 'Red', 'Large'));<br /> $this->table->add_row(array('John', 'Green', 'Medium'));<br /> <br /> echo $this->table->generate(); </code> <h2>Changing the Look of Your Table</h2> <p>The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template prototype:</p> <code> $tmpl = array (<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'table_open'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;table border="0" cellpadding="4" cellspacing="0">',<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_row_start'&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_row_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_cell_start'&nbsp;&nbsp;=> '&lt;th>',<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_cell_end'&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/th>',<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;td>',<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/td>',<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_alt_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_alt_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_alt_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;td>',<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_alt_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/td>',<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'table_close'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/table>'<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br /> <br /> $this->table->set_template($tmpl); </code> <p class="important"><strong>Note:</strong>&nbsp; You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each iteration of the row data.</p> <p>You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements. In this example, only the table opening tag is being changed:</p> <code> $tmpl = array ( 'table_open'&nbsp;&nbsp;=> '&lt;table border="1" cellpadding="2" cellspacing="1" class="mytable">' );<br /> <br /> $this->table->set_template($tmpl); </code> <br /> <h1>Function Reference</h1> <h2>$this->table->generate()</h2> <p>Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.</p> <h2>$this->table->set_caption()</h2> <p>Permits you to add a caption to the table.</p> <code>$this->table->set_caption('Colors');</code> <h2>$this->table->set_heading()</h2> <p>Permits you to set the table heading. You can submit an array or discreet params:</p> <code>$this->table->set_heading('Name', 'Color', 'Size');</code> <code>$this->table->set_heading(array('Name', 'Color', 'Size'));</code> <h2>$this->table->add_row()</h2> <p>Permits you to add a row to your table. You can submit an array or discreet params:</p> <code>$this->table->add_row('Blue', 'Red', 'Green');</code> <code>$this->table->add_row(array('Blue', 'Red', 'Green'));</code> <h2>$this->table->make_columns()</h2> <p>This function takes a one-dimensional array as input and creates a multi-dimensional array with a depth equal to the number of columns desired. This allows a single array with many elements to be displayed in a table that has a fixed column count. Consider this example:</p> <code> $list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');<br /> <br /> $new_list = $this->table->make_columns($list, 3);<br /> <br /> $this->table->generate($new_list);<br /> <br /> // Generates a table with this prototype<br /> <br /> &lt;table border="0" cellpadding="4" cellspacing="0"&gt;<br /> &lt;tr&gt;<br /> &lt;td&gt;one&lt;/td&gt;&lt;td&gt;two&lt;/td&gt;&lt;td&gt;three&lt;/td&gt;<br /> &lt;/tr&gt;&lt;tr&gt;<br /> &lt;td&gt;four&lt;/td&gt;&lt;td&gt;five&lt;/td&gt;&lt;td&gt;six&lt;/td&gt;<br /> &lt;/tr&gt;&lt;tr&gt;<br /> &lt;td&gt;seven&lt;/td&gt;&lt;td&gt;eight&lt;/td&gt;&lt;td&gt;nine&lt;/td&gt;<br /> &lt;/tr&gt;&lt;tr&gt;<br /> &lt;td&gt;ten&lt;/td&gt;&lt;td&gt;eleven&lt;/td&gt;&lt;td&gt;twelve&lt;/td&gt;&lt;/tr&gt;<br /> &lt;/table&gt;</code> <h2>$this->table->set_template()</h2> <p>Permits you to set your template. You can submit a full or partial template.</p> <code> $tmpl = array ( 'table_open'&nbsp;&nbsp;=> '&lt;table border="1" cellpadding="2" cellspacing="1" class="mytable">' );<br /> <br /> $this->table->set_template($tmpl); </code> <h2>$this->table->set_empty()</h2> <p>Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:</p> <code> $this->table->set_empty("&amp;nbsp;"); </code> <h2>$this->table->clear()</h2> <p>Lets you clear the table heading and row data. If you need to show multiple tables with different data you should to call this function after each table has been generated to empty the previous table information. Example:</p> <code> $this->load->library('table');<br /> <br /> $this->table->set_heading('Name', 'Color', 'Size');<br /> $this->table->add_row('Fred', 'Blue', 'Small');<br /> $this->table->add_row('Mary', 'Red', 'Large');<br /> $this->table->add_row('John', 'Green', 'Medium');<br /> <br /> echo $this->table->generate();<br /> <br /> <kbd>$this->table->clear();</kbd><br /> <br /> $this->table->set_heading('Name', 'Day', 'Delivery');<br /> $this->table->add_row('Fred', 'Wednesday', 'Express');<br /> $this->table->add_row('Mary', 'Monday', 'Air');<br /> $this->table->add_row('John', 'Saturday', 'Overnight');<br /> <br /> echo $this->table->generate(); </code> </div> <!-- END CONTENT --> <div id="footer"> <p> Previous Topic:&nbsp;<a href="ftp.html">&nbsp;FTP Class</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; Next Topic:&nbsp;&nbsp;<a href="image_lib.html">Image Manipulation Class</a> </p> <p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p> </div> </body> </html> \ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+
+<title>CodeIgniter User Guide : HTML Table Class</title>
+
+<style type='text/css' media='all'>@import url('../userguide.css');</style>
+<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
+
+<script type="text/javascript" src="../nav/nav.js"></script>
+<script type="text/javascript" src="../nav/prototype.lite.js"></script>
+<script type="text/javascript" src="../nav/moo.fx.js"></script>
+<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv='expires' content='-1' />
+<meta http-equiv= 'pragma' content='no-cache' />
+<meta name='robots' content='all' />
+<meta name='author' content='Rick Ellis' />
+<meta name='description' content='CodeIgniter User Guide' />
+
+</head>
+<body>
+
+<!-- START NAVIGATION -->
+<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
+<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
+<div id="masthead">
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
+<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
+</tr>
+</table>
+</div>
+<!-- END NAVIGATION -->
+
+
+<!-- START BREADCRUMB -->
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td id="breadcrumb">
+<a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
+<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
+HTML Table Class
+</td>
+<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
+</tr>
+</table>
+<!-- END BREADCRUMB -->
+
+<br clear="all" />
+
+
+<!-- START CONTENT -->
+<div id="content">
+
+
+<h1>HTML Table Class</h1>
+
+<p>The Table Class provides functions that enable you to auto-generate HTML tables from arrays or database result sets.</p>
+
+<h2>Initializing the Class</h2>
+
+<p>Like most other classes in CodeIgniter, the Table class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
+
+<code>$this->load->library('table');</code>
+<p>Once loaded, the Table library object will be available using: <dfn>$this->table</dfn></p>
+
+
+<h2>Examples</h2>
+
+<p>Here is an example showing how you can create a table from a multi-dimensional array.
+Note that the first array index will become the table heading (or you can set your own headings using the
+<dfn>set_heading()</dfn> function described in the function reference below).</p>
+
+<code>
+$this->load->library('table');<br />
+<br />
+$data = array(<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Name', 'Color', 'Size'),<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Fred', 'Blue', 'Small'),<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Mary', 'Red', 'Large'),<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('John', 'Green', 'Medium') <br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
+<br />
+echo $this->table->generate($data);
+</code>
+
+<p>Here is an example of a table created from a database query result. The table class will automatically generate the
+headings based on the table names (or you can set your own headings using the <dfn>set_heading()</dfn> function described
+in the function reference below).</p>
+
+<code>
+$this->load->library('table');<br />
+<br />
+$query = $this->db->query("SELECT * FROM my_table");<br />
+<br />
+echo $this->table->generate($query);
+</code>
+
+
+<p>Here is an example showing how you might create a table using discreet parameters:</p>
+
+<code>
+$this->load->library('table');<br />
+<br />
+$this->table->set_heading('Name', 'Color', 'Size');<br />
+<br />
+$this->table->add_row('Fred', 'Blue', 'Small');<br />
+$this->table->add_row('Mary', 'Red', 'Large');<br />
+$this->table->add_row('John', 'Green', 'Medium');<br />
+<br />
+echo $this->table->generate();
+</code>
+
+<p>Here is the same example, except instead of individual parameters, arrays are used:</p>
+
+<code>
+$this->load->library('table');<br />
+<br />
+$this->table->set_heading(array('Name', 'Color', 'Size'));<br />
+<br />
+$this->table->add_row(array('Fred', 'Blue', 'Small'));<br />
+$this->table->add_row(array('Mary', 'Red', 'Large'));<br />
+$this->table->add_row(array('John', 'Green', 'Medium'));<br />
+<br />
+echo $this->table->generate();
+</code>
+
+
+<h2>Changing the Look of Your Table</h2>
+
+<p>The Table Class permits you to set a table template with which you can specify the design of your layout. Here is the template
+prototype:</p>
+
+<code>
+$tmpl = array (<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'table_open'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;table border="0" cellpadding="4" cellspacing="0">',<br />
+<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_row_start'&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_row_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_cell_start'&nbsp;&nbsp;=> '&lt;th>',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'heading_cell_end'&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/th>',<br />
+<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;td>',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/td>',<br />
+<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_alt_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;tr>',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'row_alt_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/tr>',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_alt_start'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;td>',<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'cell_alt_end'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/td>',<br />
+<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'table_close'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=> '&lt;/table>'<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />
+
+<br />
+$this->table->set_template($tmpl);
+</code>
+
+<p class="important"><strong>Note:</strong>&nbsp; You'll notice there are two sets of "row" blocks in the template. These permit you to create alternating row colors or design elements that alternate with each
+iteration of the row data.</p>
+
+<p>You are NOT required to submit a complete template. If you only need to change parts of the layout you can simply submit those elements.
+In this example, only the table opening tag is being changed:</p>
+
+<code>
+$tmpl = array ( 'table_open'&nbsp;&nbsp;=> '&lt;table border="1" cellpadding="2" cellspacing="1" class="mytable">' );<br />
+
+<br />
+$this->table->set_template($tmpl);
+</code>
+
+<br />
+<h1>Function Reference</h1>
+
+<h2>$this->table->generate()</h2>
+<p>Returns a string containing the generated table. Accepts an optional parameter which can be an array or a database result object.</p>
+
+<h2>$this->table->set_caption()</h2>
+
+<p>Permits you to add a caption to the table.</p>
+
+<code>$this->table->set_caption('Colors');</code>
+
+<h2>$this->table->set_heading()</h2>
+
+<p>Permits you to set the table heading. You can submit an array or discreet params:</p>
+
+<code>$this->table->set_heading('Name', 'Color', 'Size');</code>
+<code>$this->table->set_heading(array('Name', 'Color', 'Size'));</code>
+
+<h2>$this->table->add_row()</h2>
+
+<p>Permits you to add a row to your table. You can submit an array or discreet params:</p>
+
+<code>$this->table->add_row('Blue', 'Red', 'Green');</code>
+<code>$this->table->add_row(array('Blue', 'Red', 'Green'));</code>
+
+
+<h2>$this->table->make_columns()</h2>
+
+<p>This function takes a one-dimensional array as input and creates
+a multi-dimensional array with a depth equal to the number of
+columns desired. This allows a single array with many elements to be
+displayed in a table that has a fixed column count. Consider this example:</p>
+
+<code>
+$list = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve');<br />
+<br />
+$new_list = $this->table->make_columns($list, 3);<br />
+<br />
+$this->table->generate($new_list);<br />
+<br />
+// Generates a table with this prototype<br />
+<br />
+&lt;table border="0" cellpadding="4" cellspacing="0"&gt;<br />
+&lt;tr&gt;<br />
+&lt;td&gt;one&lt;/td&gt;&lt;td&gt;two&lt;/td&gt;&lt;td&gt;three&lt;/td&gt;<br />
+&lt;/tr&gt;&lt;tr&gt;<br />
+&lt;td&gt;four&lt;/td&gt;&lt;td&gt;five&lt;/td&gt;&lt;td&gt;six&lt;/td&gt;<br />
+&lt;/tr&gt;&lt;tr&gt;<br />
+&lt;td&gt;seven&lt;/td&gt;&lt;td&gt;eight&lt;/td&gt;&lt;td&gt;nine&lt;/td&gt;<br />
+&lt;/tr&gt;&lt;tr&gt;<br />
+&lt;td&gt;ten&lt;/td&gt;&lt;td&gt;eleven&lt;/td&gt;&lt;td&gt;twelve&lt;/td&gt;&lt;/tr&gt;<br />
+&lt;/table&gt;</code>
+
+
+
+<h2>$this->table->set_template()</h2>
+
+<p>Permits you to set your template. You can submit a full or partial template.</p>
+
+<code>
+$tmpl = array ( 'table_open'&nbsp;&nbsp;=> '&lt;table border="1" cellpadding="2" cellspacing="1" class="mytable">' );<br />
+
+<br />
+$this->table->set_template($tmpl);
+</code>
+
+
+<h2>$this->table->set_empty()</h2>
+
+<p>Let's you set a default value for use in any table cells that are empty. You might, for example, set a non-breaking space:</p>
+
+<code>
+$this->table->set_empty("&amp;nbsp;");
+</code>
+
+<h2>$this->table->clear()</h2>
+
+<p>Lets you clear the table heading and row data. If you need to show multiple tables with different data you should
+to call this function after each table has been generated to empty the previous table information. Example:</p>
+
+<code>
+$this->load->library('table');<br />
+<br />
+$this->table->set_heading('Name', 'Color', 'Size');<br />
+$this->table->add_row('Fred', 'Blue', 'Small');<br />
+$this->table->add_row('Mary', 'Red', 'Large');<br />
+$this->table->add_row('John', 'Green', 'Medium');<br />
+<br />
+echo $this->table->generate();<br />
+<br />
+<kbd>$this->table->clear();</kbd><br />
+<br />
+$this->table->set_heading('Name', 'Day', 'Delivery');<br />
+$this->table->add_row('Fred', 'Wednesday', 'Express');<br />
+$this->table->add_row('Mary', 'Monday', 'Air');<br />
+$this->table->add_row('John', 'Saturday', 'Overnight');<br />
+<br />
+echo $this->table->generate();
+</code>
+
+</div>
+<!-- END CONTENT -->
+
+
+<div id="footer">
+<p>
+Previous Topic:&nbsp;<a href="ftp.html">&nbsp;FTP Class</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+Next Topic:&nbsp;&nbsp;<a href="image_lib.html">Image Manipulation Class</a>
+</p>
+<p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
+</div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html
index a971cb0c9..096e16ac2 100644
--- a/user_guide/libraries/trackback.html
+++ b/user_guide/libraries/trackback.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html
index e2f1d114b..1f37649c3 100644
--- a/user_guide/libraries/unit_testing.html
+++ b/user_guide/libraries/unit_testing.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html
index 4b71480bb..2306d82ad 100644
--- a/user_guide/libraries/uri.html
+++ b/user_guide/libraries/uri.html
@@ -1 +1,252 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>CodeIgniter User Guide : URI Class</title> <style type='text/css' media='all'>@import url('../userguide.css');</style> <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' /> <script type="text/javascript" src="../nav/nav.js"></script> <script type="text/javascript" src="../nav/prototype.lite.js"></script> <script type="text/javascript" src="../nav/moo.fx.js"></script> <script type="text/javascript" src="../nav/user_guide_menu.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv='expires' content='-1' /> <meta http-equiv= 'pragma' content='no-cache' /> <meta name='robots' content='all' /> <meta name='author' content='Rick Ellis' /> <meta name='description' content='CodeIgniter User Guide' /> </head> <body> <!-- START NAVIGATION --> <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div> <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div> <div id="masthead"> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td><h1>CodeIgniter User Guide Version 1.5.4</h1></td> <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td> </tr> </table> </div> <!-- END NAVIGATION --> <!-- START BREADCRUMB --> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td id="breadcrumb"> <a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp; <a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp; URI Class </td> <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td> </tr> </table> <!-- END BREADCRUMB --> <br clear="all" /> <!-- START CONTENT --> <div id="content"> <h1>URI Class</h1> <p>The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can also retrieve information about the re-routed segments.</p> <p class="important"><strong>Note:</strong> This class is initialized automatically by the system so there is no need to do it manually.</p> <h2>$this->uri->segment(<var>n</var>)</h2> <p>Permits you to retrieve a specific segment. Where <var>n</var> is the segment number you wish to retrieve. Segments are numbered from left to right. For example, if your full URL is this:</p> <code>http://www.your-site.com/index.php/news/local/metro/crime_is_up</code> <p>The segment numbers would be this:</p> <ol> <li>news</li> <li>local</li> <li>metro</li> <li>crime_is_up</li> </ol> <p>By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that permits you to set your own default value if the segment is missing. For example, this would tell the function to return the number zero in the event of failure:</p> <code>$product_id = $this->uri->segment(3, 0);</code> <p>It helps avoid having to write code like this:</p> <code>if ($this->uri->segment(3) === FALSE)<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;$product_id = 0;<br /> }<br /> else<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;$product_id = $this->uri->segment(3);<br /> }<br /> </code> <h2>$this->uri->rsegment(<var>n</var>)</h2> <p>This function is identical to the previous one, except that it lets you retrieve a specific segment from your re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p> <h2>$this->uri->slash_segment(<var>n</var>)</h2> <p>This function is almost identical to <dfn>$this->uri->segment()</dfn>, except it adds a trailing and/or leading slash based on the second parameter. If the parameter is not used, a trailing slash added. Examples:</p> <code>$this->uri->slash_segment(<var>3</var>);<br /> $this->uri->slash_segment(<var>3</var>, 'leading');<br /> $this->uri->slash_segment(<var>3</var>, 'both');</code> <p>Returns:</p> <ol> <li>segment/</li> <li>/segment</li> <li>/segment/</li> </ol> <h2>$this->uri->slash_rsegment(<var>n</var>)</h2> <p>This function is identical to the previous one, except that it lets you add slashes a specific segment from your re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p> <h2>$this->uri->uri_to_assoc(<var>n</var>)</h2> <p>This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:</p> <code>index.php/user/search/name/joe/location/UK/gender/male</code> <p>Using this function you can turn the URI into an associative array with this prototype:</p> <code>[array]<br /> (<br /> &nbsp;&nbsp;&nbsp;&nbsp;'name' => 'joe'<br /> &nbsp;&nbsp;&nbsp;&nbsp;'location' => 'UK'<br /> &nbsp;&nbsp;&nbsp;&nbsp;'gender' => 'male'<br /> )</code> <p>The first parameter of the function lets you set an offset. By default it is set to <kbd>3</kbd> since your URI will normally contain a controller/function in the first and second segments. Example:</p> <code> $array = $this->uri->uri_to_assoc(3);<br /> <br /> echo $array['name']; </code> <p>The second parameter lets you set default key names, so that the array returned by the function will always contain expected indexes, even if missing from the URI. Example:</p> <code> $default = array('name', 'gender', 'location', 'type', 'sort');<br /> <br /> $array = $this->uri->uri_to_assoc(3, $default);</code> <p>If the URI does not contain a value in your default, an array index will be set to that name, with a value of FALSE.</p> <p>Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).</p> <h2>$this->uri->ruri_to_assoc(<var>n</var>)</h2> <p>This function is identical to the previous one, except that it creates an associative array using the re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p> <h2>$this->uri->assoc_to_uri()</h2> <p>Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:</p> <code>$array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');<br /> <br /> $str = $this->uri->assoc_to_uri($array);<br /> <br /> // Produces: product/shoes/size/large/color/red </code> <h2>$this->uri->uri_string()</h2> <p>Returns a string with the complete URI. For example, if this is your full URL:</p> <code>http://www.your-site.com/index.php/news/local/345</code> <p>The function would return this:</p> <code>/news/local/345</code> <h2>$this->uri->ruri_string(<var>n</var>)</h2> <p>This function is identical to the previous one, except that it returns the re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p> <h2>$this->uri->total_segments()</h2> <p>Returns the total number of segments.</p> <h2>$this->uri->total_rsegments(<var>n</var>)</h2> <p>This function is identical to the previous one, except that it returns the total number of segments in your re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p> <h2>$this->uri->segment_array()</h2> <p>Returns an array containing the URI segments. For example:</p> <code> $segs = $this->uri->segment_array();<br /> <br /> foreach ($segs as $segment)<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;echo $segment;<br /> &nbsp;&nbsp;&nbsp;&nbsp;echo '&lt;br />';<br /> }</code> <h2>$this->uri->rsegment_array(<var>n</var>)</h2> <p>This function is identical to the previous one, except that it returns the array of segments in your re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature. </div> <!-- END CONTENT --> <div id="footer"> <p> Previous Topic:&nbsp;&nbsp;<a href="unit_testing.html">Unit Testing Class</a> &nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; Next Topic:&nbsp;&nbsp;<a href="user_agent.html">User Agent Class</a> </p> <p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p> </div> </body> </html> \ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+
+<title>CodeIgniter User Guide : URI Class</title>
+
+<style type='text/css' media='all'>@import url('../userguide.css');</style>
+<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
+
+<script type="text/javascript" src="../nav/nav.js"></script>
+<script type="text/javascript" src="../nav/prototype.lite.js"></script>
+<script type="text/javascript" src="../nav/moo.fx.js"></script>
+<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv='expires' content='-1' />
+<meta http-equiv= 'pragma' content='no-cache' />
+<meta name='robots' content='all' />
+<meta name='author' content='Rick Ellis' />
+<meta name='description' content='CodeIgniter User Guide' />
+
+</head>
+<body>
+
+<!-- START NAVIGATION -->
+<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
+<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
+<div id="masthead">
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
+<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
+</tr>
+</table>
+</div>
+<!-- END NAVIGATION -->
+
+
+<!-- START BREADCRUMB -->
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td id="breadcrumb">
+<a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
+<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
+URI Class
+</td>
+<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
+</tr>
+</table>
+<!-- END BREADCRUMB -->
+
+<br clear="all" />
+
+
+<!-- START CONTENT -->
+<div id="content">
+
+
+<h1>URI Class</h1>
+
+<p>The URI Class provides functions that help you retrieve information from your URI strings. If you use URI routing, you can
+also retrieve information about the re-routed segments.</p>
+
+<p class="important"><strong>Note:</strong> This class is initialized automatically by the system so there is no need to do it manually.</p>
+
+<h2>$this->uri->segment(<var>n</var>)</h2>
+
+<p>Permits you to retrieve a specific segment. Where <var>n</var> is the segment number you wish to retrieve.
+Segments are numbered from left to right. For example, if your full URL is this:</p>
+
+<code>http://www.your-site.com/index.php/news/local/metro/crime_is_up</code>
+
+<p>The segment numbers would be this:</p>
+
+<ol>
+<li>news</li>
+<li>local</li>
+<li>metro</li>
+<li>crime_is_up</li>
+</ol>
+
+<p>By default the function returns FALSE (boolean) if the segment does not exist. There is an optional second parameter that
+permits you to set your own default value if the segment is missing.
+For example, this would tell the function to return the number zero in the event of failure:</p>
+
+<code>$product_id = $this->uri->segment(3, 0);</code>
+
+<p>It helps avoid having to write code like this:</p>
+
+<code>if ($this->uri->segment(3) === FALSE)<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$product_id = 0;<br />
+}<br />
+else<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$product_id = $this->uri->segment(3);<br />
+}<br />
+</code>
+
+<h2>$this->uri->rsegment(<var>n</var>)</h2>
+
+<p>This function is identical to the previous one, except that it lets you retrieve a specific segment from your
+re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p>
+
+
+<h2>$this->uri->slash_segment(<var>n</var>)</h2>
+
+<p>This function is almost identical to <dfn>$this->uri->segment()</dfn>, except it adds a trailing and/or leading slash based on the second
+parameter. If the parameter is not used, a trailing slash added. Examples:</p>
+
+<code>$this->uri->slash_segment(<var>3</var>);<br />
+$this->uri->slash_segment(<var>3</var>, 'leading');<br />
+$this->uri->slash_segment(<var>3</var>, 'both');</code>
+
+<p>Returns:</p>
+
+<ol>
+<li>segment/</li>
+<li>/segment</li>
+<li>/segment/</li>
+</ol>
+
+
+<h2>$this->uri->slash_rsegment(<var>n</var>)</h2>
+
+<p>This function is identical to the previous one, except that it lets you add slashes a specific segment from your
+re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p>
+
+
+
+<h2>$this->uri->uri_to_assoc(<var>n</var>)</h2>
+
+<p>This function lets you turn URI segments into and associative array of key/value pairs. Consider this URI:</p>
+
+<code>index.php/user/search/name/joe/location/UK/gender/male</code>
+
+<p>Using this function you can turn the URI into an associative array with this prototype:</p>
+
+<code>[array]<br />
+(<br />
+&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'joe'<br />
+&nbsp;&nbsp;&nbsp;&nbsp;'location' => 'UK'<br />
+&nbsp;&nbsp;&nbsp;&nbsp;'gender' => 'male'<br />
+)</code>
+
+<p>The first parameter of the function lets you set an offset. By default it is set to <kbd>3</kbd> since your
+URI will normally contain a controller/function in the first and second segments. Example:</p>
+
+<code>
+$array = $this->uri->uri_to_assoc(3);<br />
+<br />
+echo $array['name'];
+</code>
+
+
+<p>The second parameter lets you set default key names, so that the array returned by the function will always contain expected indexes, even if missing from the URI. Example:</p>
+
+<code>
+$default = array('name', 'gender', 'location', 'type', 'sort');<br />
+<br />
+$array = $this->uri->uri_to_assoc(3, $default);</code>
+
+<p>If the URI does not contain a value in your default, an array index will be set to that name, with a value of FALSE.</p>
+
+<p>Lastly, if a corresponding value is not found for a given key (if there is an odd number of URI segments) the value will be set to FALSE (boolean).</p>
+
+
+<h2>$this->uri->ruri_to_assoc(<var>n</var>)</h2>
+
+<p>This function is identical to the previous one, except that it creates an associative array using the
+re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p>
+
+
+<h2>$this->uri->assoc_to_uri()</h2>
+
+<p>Takes an associative array as input and generates a URI string from it. The array keys will be included in the string. Example:</p>
+
+<code>$array = array('product' => 'shoes', 'size' => 'large', 'color' => 'red');<br />
+<br />
+$str = $this->uri->assoc_to_uri($array);<br />
+<br />
+// Produces: product/shoes/size/large/color/red
+</code>
+
+
+<h2>$this->uri->uri_string()</h2>
+
+<p>Returns a string with the complete URI. For example, if this is your full URL:</p>
+
+<code>http://www.your-site.com/index.php/news/local/345</code>
+
+<p>The function would return this:</p>
+
+<code>/news/local/345</code>
+
+
+<h2>$this->uri->ruri_string(<var>n</var>)</h2>
+
+<p>This function is identical to the previous one, except that it returns the
+re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p>
+
+
+
+<h2>$this->uri->total_segments()</h2>
+
+<p>Returns the total number of segments.</p>
+
+
+<h2>$this->uri->total_rsegments(<var>n</var>)</h2>
+
+<p>This function is identical to the previous one, except that it returns the total number of segments in your
+re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.</p>
+
+
+
+<h2>$this->uri->segment_array()</h2>
+
+<p>Returns an array containing the URI segments. For example:</p>
+
+<code>
+$segs = $this->uri->segment_array();<br />
+<br />
+foreach ($segs as $segment)<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;echo $segment;<br />
+&nbsp;&nbsp;&nbsp;&nbsp;echo '&lt;br />';<br />
+}</code>
+
+<h2>$this->uri->rsegment_array(<var>n</var>)</h2>
+
+<p>This function is identical to the previous one, except that it returns the array of segments in your
+re-routed URI in the event you are using CodeIgniter's <a href="../general/routing.html">URI Routing</a> feature.
+
+
+
+</div>
+<!-- END CONTENT -->
+
+
+<div id="footer">
+<p>
+Previous Topic:&nbsp;&nbsp;<a href="unit_testing.html">Unit Testing Class</a>
+&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+Next Topic:&nbsp;&nbsp;<a href="user_agent.html">User Agent Class</a>
+</p>
+<p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
+</div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html
index 7dc747ef6..ab37935ec 100644
--- a/user_guide/libraries/user_agent.html
+++ b/user_guide/libraries/user_agent.html
@@ -1 +1,201 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>CodeIgniter User Guide : User Agent Class</title> <style type='text/css' media='all'>@import url('../userguide.css');</style> <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' /> <script type="text/javascript" src="../nav/nav.js"></script> <script type="text/javascript" src="../nav/prototype.lite.js"></script> <script type="text/javascript" src="../nav/moo.fx.js"></script> <script type="text/javascript" src="../nav/user_guide_menu.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv='expires' content='-1' /> <meta http-equiv= 'pragma' content='no-cache' /> <meta name='robots' content='all' /> <meta name='author' content='Rick Ellis' /> <meta name='description' content='CodeIgniter User Guide' /> </head> <body> <!-- START NAVIGATION --> <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div> <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div> <div id="masthead"> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td><h1>CodeIgniter User Guide Version 1.5.4</h1></td> <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td> </tr> </table> </div> <!-- END NAVIGATION --> <!-- START BREADCRUMB --> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td id="breadcrumb"> <a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp; <a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp; User Agent Class </td> <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td> </tr> </table> <!-- END BREADCRUMB --> <br clear="all" /> <!-- START CONTENT --> <div id="content"> <h1>User Agent Class</h1> <p>The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. In addition you can get referrer information as well as language and supported character-set information.</p> <h2>Initializing the Class</h2> <p>Like most other classes in CodeIgniter, the User Agent class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p> <code>$this->load->library('user_agent');</code> <p>Once loaded, the object will be available using: <dfn>$this->agent</dfn></p> <h2>User Agent Definitions</h2> <p>The user agent name definitions are located in a config file located at: <dfn>application/config/user_agents.php</dfn>. You may add items to the various user agent arrays if needed.</p> <h2>Example</h2> <p>When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.</p> <code> $this->load->library('user_agent');<br /> <br /> if ($this->agent->is_browser())<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;$agent = $this->agent->browser().' '.$this->agent->version();<br /> }<br /> elseif ($this->agent->is_robot())<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;$agent = $this->agent->robot();<br /> }<br /> elseif ($this->agent->is_mobile())<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;$agent = $this->agent->mobile();<br /> }<br /> else<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;$agent = 'Unidentified User Agent';<br /> }<br /> <br /> echo $agent;<br /> <br /> echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.) </code> <h1>Function Reference</h1> <h2>$this->agent->is_browser()</h2> <p>Returns TRUE/FALSE (boolean) if the user agent is a known web browser.</p> <h2>$this->agent->is_mobile()</h2> <p>Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.</p> <h2>$this->agent->is_robot()</h2> <p>Returns TRUE/FALSE (boolean) if the user agent is a known robot.</p> <p class="important"><strong>Note:</strong>&nbsp; The user agent library only contains the most common robot definitions. It is not a complete list of bots. There are hundreds of them so searching for each one would not be very efficient. If you find that some bots that commonly visit your site are missing from the list you can add them to your <dfn>application/config/user_agents.php</dfn> file.</p> <h2>$this->agent->is_referral()</h2> <p>Returns TRUE/FALSE (boolean) if the user agent was referred from another site.</p> <h2>$this->agent->browser()</h2> <p>Returns a string containing the name of the web browser viewing your site.</p> <h2>$this->agent->version()</h2> <p>Returns a string containing the version number of the web browser viewing your site.</p> <h2>$this->agent->mobile()</h2> <p>Returns a string containing the name of the mobile device viewing your site.</p> <h2>$this->agent->robot()</h2> <p>Returns a string containing the name of the robot viewing your site.</p> <h2>$this->agent->platform()</h2> <p>Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).</p> <h2>$this->agent->referrer()</h2> <p>The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:</p> <code> if ($this->agent->is_referral())<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;echo $this->agent->referrer();<br /> }</code> <h2>$this->agent->agent_string()</h2> <p>Returns a string containing the full user agent string. Typically it will be something like this:</p> <code>Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2</code> <h2>$this->agent->accept_lang()</h2> <p>Lets you determine if the user agent accepts a particular language. Example:</p> <code>if ($this->agent->accept_lang('en'))<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;echo 'You accept English!';<br /> }</code> <p class="important"><strong>Note:</strong> This function is not typically very reliable since some browsers do not provide language info, and even among those that do, it is not always accurate. </p> <h2>$this->agent->accept_charset()</h2> <p>Lets you determine if the user agent accepts a particular character set. Example:</p> <code>if ($this->agent->accept_charset('utf-8'))<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;echo 'You browser supports UTF-8!';<br /> }</code> <p class="important"><strong>Note:</strong> This function is not typically very reliable since some browsers do not provide character-set info, and even among those that do, it is not always accurate. </p> </div> <!-- END CONTENT --> <div id="footer"> <p> Previous Topic:&nbsp;&nbsp;<a href="uri.html">URI Class</a> &nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; Next Topic:&nbsp;&nbsp;<a href="validation.html">Validation Class</a> </p> <p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p> </div> </body> </html> \ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+
+<title>CodeIgniter User Guide : User Agent Class</title>
+
+<style type='text/css' media='all'>@import url('../userguide.css');</style>
+<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
+
+<script type="text/javascript" src="../nav/nav.js"></script>
+<script type="text/javascript" src="../nav/prototype.lite.js"></script>
+<script type="text/javascript" src="../nav/moo.fx.js"></script>
+<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv='expires' content='-1' />
+<meta http-equiv= 'pragma' content='no-cache' />
+<meta name='robots' content='all' />
+<meta name='author' content='Rick Ellis' />
+<meta name='description' content='CodeIgniter User Guide' />
+
+</head>
+<body>
+
+<!-- START NAVIGATION -->
+<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
+<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
+<div id="masthead">
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
+<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
+</tr>
+</table>
+</div>
+<!-- END NAVIGATION -->
+
+
+<!-- START BREADCRUMB -->
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td id="breadcrumb">
+<a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
+<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
+User Agent Class
+</td>
+<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
+</tr>
+</table>
+<!-- END BREADCRUMB -->
+
+<br clear="all" />
+
+
+<!-- START CONTENT -->
+<div id="content">
+
+
+<h1>User Agent Class</h1>
+
+<p>The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site.
+In addition you can get referrer information as well as language and supported character-set information.</p>
+
+<h2>Initializing the Class</h2>
+
+<p>Like most other classes in CodeIgniter, the User Agent class is initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
+
+<code>$this->load->library('user_agent');</code>
+<p>Once loaded, the object will be available using: <dfn>$this->agent</dfn></p>
+
+<h2>User Agent Definitions</h2>
+
+<p>The user agent name definitions are located in a config file located at: <dfn>application/config/user_agents.php</dfn>. You may add items to the
+various user agent arrays if needed.</p>
+
+<h2>Example</h2>
+
+<p>When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is
+a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.</p>
+
+
+<code>
+$this->load->library('user_agent');<br />
+<br />
+if ($this->agent->is_browser())<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$agent = $this->agent->browser().' '.$this->agent->version();<br />
+}<br />
+elseif ($this->agent->is_robot())<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$agent = $this->agent->robot();<br />
+}<br />
+elseif ($this->agent->is_mobile())<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$agent = $this->agent->mobile();<br />
+}<br />
+else<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;$agent = 'Unidentified User Agent';<br />
+}<br />
+<br />
+echo $agent;<br />
+<br />
+echo $this->agent->platform(); // Platform info (Windows, Linux, Mac, etc.)
+</code>
+
+
+<h1>Function Reference</h1>
+
+
+<h2>$this->agent->is_browser()</h2>
+<p>Returns TRUE/FALSE (boolean) if the user agent is a known web browser.</p>
+
+<h2>$this->agent->is_mobile()</h2>
+<p>Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.</p>
+
+<h2>$this->agent->is_robot()</h2>
+<p>Returns TRUE/FALSE (boolean) if the user agent is a known robot.</p>
+
+<p class="important"><strong>Note:</strong>&nbsp; The user agent library only contains the most common robot
+definitions. It is not a complete list of bots. There are hundreds of them so searching for each one would not be
+very efficient. If you find that some bots that commonly visit your site are missing from the list you can add them to your
+<dfn>application/config/user_agents.php</dfn> file.</p>
+
+<h2>$this->agent->is_referral()</h2>
+<p>Returns TRUE/FALSE (boolean) if the user agent was referred from another site.</p>
+
+
+<h2>$this->agent->browser()</h2>
+<p>Returns a string containing the name of the web browser viewing your site.</p>
+
+<h2>$this->agent->version()</h2>
+<p>Returns a string containing the version number of the web browser viewing your site.</p>
+
+<h2>$this->agent->mobile()</h2>
+<p>Returns a string containing the name of the mobile device viewing your site.</p>
+
+<h2>$this->agent->robot()</h2>
+<p>Returns a string containing the name of the robot viewing your site.</p>
+
+<h2>$this->agent->platform()</h2>
+<p>Returns a string containing the platform viewing your site (Linux, Windows, OS X, etc.).</p>
+
+<h2>$this->agent->referrer()</h2>
+<p>The referrer, if the user agent was referred from another site. Typically you'll test for this as follows:</p>
+
+<code> if ($this->agent->is_referral())<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;echo $this->agent->referrer();<br />
+}</code>
+
+
+<h2>$this->agent->agent_string()</h2>
+<p>Returns a string containing the full user agent string. Typically it will be something like this:</p>
+
+<code>Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2</code>
+
+
+<h2>$this->agent->accept_lang()</h2>
+<p>Lets you determine if the user agent accepts a particular language. Example:</p>
+
+<code>if ($this->agent->accept_lang('en'))<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;echo 'You accept English!';<br />
+}</code>
+
+<p class="important"><strong>Note:</strong> This function is not typically very reliable
+since some browsers do not provide language info, and even among those that do, it is not always accurate. </p>
+
+
+
+<h2>$this->agent->accept_charset()</h2>
+<p>Lets you determine if the user agent accepts a particular character set. Example:</p>
+
+<code>if ($this->agent->accept_charset('utf-8'))<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;echo 'You browser supports UTF-8!';<br />
+}</code>
+
+<p class="important"><strong>Note:</strong> This function is not typically very reliable
+since some browsers do not provide character-set info, and even among those that do, it is not always accurate. </p>
+
+
+
+</div>
+<!-- END CONTENT -->
+
+
+<div id="footer">
+<p>
+Previous Topic:&nbsp;&nbsp;<a href="uri.html">URI Class</a>
+&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+Next Topic:&nbsp;&nbsp;<a href="validation.html">Validation Class</a>
+</p>
+<p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
+</div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/user_guide/libraries/validation.html b/user_guide/libraries/validation.html
index 90ff0c127..30de0fd2b 100644
--- a/user_guide/libraries/validation.html
+++ b/user_guide/libraries/validation.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html
index cd2f9e306..039127913 100644
--- a/user_guide/libraries/xmlrpc.html
+++ b/user_guide/libraries/xmlrpc.html
@@ -1 +1,487 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>CodeIgniter User Guide : XML-RPC and XML-RPC Server Classes</title> <style type='text/css' media='all'>@import url('../userguide.css');</style> <link rel='stylesheet' type='text/css' media='all' href='../userguide.css' /> <script type="text/javascript" src="../nav/nav.js"></script> <script type="text/javascript" src="../nav/prototype.lite.js"></script> <script type="text/javascript" src="../nav/moo.fx.js"></script> <script type="text/javascript" src="../nav/user_guide_menu.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv='expires' content='-1' /> <meta http-equiv= 'pragma' content='no-cache' /> <meta name='robots' content='all' /> <meta name='author' content='Rick Ellis' /> <meta name='description' content='CodeIgniter User Guide' /> </head> <body> <!-- START NAVIGATION --> <div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div> <div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div> <div id="masthead"> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td><h1>CodeIgniter User Guide Version 1.5.4</h1></td> <td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td> </tr> </table> </div> <!-- END NAVIGATION --> <!-- START BREADCRUMB --> <table cellpadding="0" cellspacing="0" border="0" style="width:100%"> <tr> <td id="breadcrumb"> <a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp; <a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp; XML-RPC and XML-RPC Server Classes </td> <td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td> </tr> </table> <!-- END BREADCRUMB --> <br clear="all" /> <!-- START CONTENT --> <div id="content"> <h1>XML-RPC and XML-RPC Server Classes</h1> <p>CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up your own XML-RPC server to receive requests.</p> <h2>What is XML-RPC?</h2> <p>Quite simply it is a way for two computers to communicate over the internet using XML. One computer, which we will call the <dfn>client</dfn>, sends an XML-RPC <strong>request</strong> to another computer, which we will call the <dfn>server</dfn>. Once the server receives and processes the request it will send back a <strong>response</strong> to the client.</p> <p>For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will send a request to an XML-RPC Server running on your site. This request might be a new weblog entry being sent for publication, or it could be a request for an existing entry for editing. When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. Once processed, the server will then send back a response message.</p> <p>For detailed specifications, you can visit the <a href="http://www.xmlrpc.com/">XML-RPC</a> site.</p> <h2>Initializing the Class</h2> <p>Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the <dfn>$this->load->library</dfn> function:</p> <p>To load the XML-RPC class you will use:</p> <code>$this->load->library('xmlrpc');</code> <p>Once loaded, the xml-rpc library object will be available using: <dfn>$this->xmlrpc</dfn></p> <p>To load the XML-RPC Server class you will use:</p> <code> $this->load->library('xmlrpc');<br /> $this->load->library('xmlrpcs'); </code> <p>Once loaded, the xml-rpcs library object will be available using: <dfn>$this->xmlrpcs</dfn></p> <p class="important"><strong>Note:</strong>&nbsp; When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.</p> <h2>Sending XML-RPC Requests</h2> <p>To send a request to an XML-RPC server you must specify the following information:</p> <ul> <li>The URL of the server</li> <li>The method on the server you wish to call</li> <li>The <em>request</em> data (explained below).</li> </ul> <p>Here is a basic example that sends a simple Weblogs.com ping to the <a href="http://pingomatic.com/">Ping-o-Matic</a></p> <code>$this->load->library('xmlrpc');<br /> <br /> $this->xmlrpc->server('http://rpc.pingomatic.com/', 80);<br /> $this->xmlrpc->method('weblogUpdates.ping');<br /> <br /> $request = array('My Photoblog', 'http://www.my-site.com/photoblog/');<br /> $this->xmlrpc->request($request);<br /> <br /> if ( ! $this->xmlrpc->send_request())<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;echo $this-&gt;xmlrpc->display_error();<br /> }</code> <h3>Explanation</h3> <p>The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The request (in this case, the title and URL of your site) is placed into an array for transportation, and compiled using the request() function. Lastly, the full request is sent. If the <dfn>send_request()</dfn> method returns false we will display the error message sent back from the XML-RPC Server.</p> <h2>Anatomy of a Request</h2> <p>An XML-RPC <dfn>request</dfn> is simply the data you are sending to the XML-RPC server. Each piece of data in a request is referred to as a <dfn>request parameter</dfn>. The above example has two parameters: The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.</p> <p>Request parameters must be placed into an array for transportation, and each parameter can be one of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings you will have to include the data type in the request array.</p> <p>Here is an example of a simple array with three parameters:</p> <code>$request = array('John', 'Doe', 'www.some-site.com');<br /> $this->xmlrpc->request($request);</code> <p>If you use data types other than strings, or if you have several different data types, you will place each parameter into its own array, with the data type in the second position:</p> <code> $request = array (<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('John', 'string'),<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Doe', 'string'),<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(FALSE, 'boolean'),<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(12345, 'int')<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;); <br /> $this->xmlrpc->request($request);</code> The <a href="#datatypes">Data Types</a> section below has a full list of data types. <h2>Creating an XML-RPC Server</h2> <p>An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the appropriate functions for processing.</p> <p>To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate class and method for processing.</p> <p>Here is an example to illustrate:</p> <code> $this->load->library('xmlrpc');<br /> $this->load->library('xmlrpcs');<br /> <br /> $config['functions']['<var>new_post</var>']&nbsp;&nbsp;= array('function' => '<dfn>My_blog.new_entry</dfn>');<br /> $config['functions']['<var>update_post</var>'] = array('function' => '<dfn>My_blog.update_entry</dfn>');<br /> <br /> $this->xmlrpcs->initialize($config);<br /> $this->xmlrpcs->serve();</code> <p>The above example contains an array specifying two method requests that the Server allows. The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.</p> <p>In other words, if an XML-RPC Client sends a request for the <var>new_post</var> method, your server will load the <dfn>My_blog</dfn> class and call the <dfn>new_entry</dfn> function. If the request is for the <var>update_post</var> method, your server will load the <dfn>My_blog</dfn> class and call the <dfn>update_entry</dfn> function.</p> <p>The function names in the above example are arbitrary. You'll decide what they should be called on your server, or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.</p> <h2>Processing Server Requests</h2> <p>When the XML-RPC Server receives a request and loads the class/method for processing, it will pass an object to that method containing the data sent by the client.</p> <p>Using the above example, if the <var>new_post</var> method is requested, the server will expect a class to exist with this prototype:</p> <code>class <kbd>My_blog</kbd> extends Controller {<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;function <kbd>new_post</kbd>(<var>$request</var>)<br /> &nbsp;&nbsp;&nbsp;&nbsp;{<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> } </code> <p>The <var>$request</var> variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. Using this object you will have access to the <em>request parameters</em> enabling you to process the request. When you are done you will send a <dfn>Response</dfn> back to the Client.</p> <p>Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is <dfn>getUserInfo()</dfn>. Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing function might look:</p> <code>class <kbd>My_blog</kbd> extends Controller {<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;function <kbd>getUserInfo</kbd>(<var>$request</var>)<br /> &nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$username = 'smitty';<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$password = 'secretsmittypass';<br /><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->library('xmlrpc');<br /> &nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$parameters&nbsp;=&nbsp;$request->output_parameters();<br /> &nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($parameters['1'] != $username AND $parameters['2'] != $password)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$this->xmlrpc->send_error_message('100',&nbsp;'Invalid&nbsp;Access');<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$response&nbsp;=&nbsp;array(array('nickname'&nbsp;&nbsp;=>&nbsp;array('Smitty','string'),<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;'userid'&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;array('99','string'),<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;'url'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;array('http://yoursite.com','string'),<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;'email'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;array('jsmith@yoursite.com','string'),<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;'lastname'&nbsp;&nbsp;=>&nbsp;array('Smith','string'),<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;'firstname'&nbsp;=>&nbsp;array('John','string')<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;),<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;'struct');<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $this->xmlrpc->send_response($response);<br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> } </code> <h3>Notes:</h3> <p>The <dfn>output_parameters()</dfn> function retrieves an indexed array corresponding to the request parameters sent by the client. In the above example, the output parameters will be the username and password.</p> <p>If the username and password sent by the client were not valid, and error message is returned using <dfn>send_error_message()</dfn>.</p> <p>If the operation was successful, the client will be sent back a response array containing the user's info.</p> <h2>Formatting a Response</h2> <p>Similar to <em>Requests</em>, <em>Responses</em> must be formatted as an array. However, unlike requests, a response is an array <strong>that contains a single item</strong>. This item can be an array with several additional arrays, but there can be only one primary array index. In other words, the basic prototype is this:</p> <code>$response = array('Response data', 'array');</code> <p>Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:</p> <code> $response = array (<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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;'first_name' => array('John', 'string'),<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;'last_name' => array('Doe', 'string'),<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;'member_id' => array(123435, 'int'),<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;'todo_list' => array(array('clean house', 'call mom', 'water plants'), '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;),<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'struct'<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;); </code> <p class="important">Notice that the above array is formatted as a <dfn>struct</dfn>. This is the most common data type for responses.</p> <p>As with Requests, a response can be on of the seven data types listed in the <a href="#datatypes">Data Types</a> section.</p> <h2>Sending an Error Response</h2> <p>If you need to send the client an error response you will use the following:</p> <code>return $this->xmlrpc->send_error_message('123', 'Requested data not available');</code> <p>The first parameter is the error number while the second parameter is the error message.</p> <h2>Creating Your Own Client and Server</h2> <p>To help you understand everything we've covered thus far, let's create a couple controllers that act as XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.</p> <h3>The Client</h3> <p>Using a text editor, create a controller called <dfn>xmlrpc_client.php</dfn>. In it, place this code and save it to your <samp>applications/controllers/</samp> folder:</p> <textarea class="textarea" style="width:100%" cols="50" rows="32"><?php class Xmlrpc_client extends Controller { function index() { $this->load->helper('url'); $server_url = site_url('xmlrpc_server'); $this->load->library('xmlrpc'); $this->xmlrpc->server($server_url, 80); $this->xmlrpc->method('Greetings'); $request = array('How is it going?'); $this->xmlrpc->request($request); if ( ! $this->xmlrpc->send_request()) { echo $this->xmlrpc->display_error(); } else { echo '<pre>'; print_r($this->xmlrpc->display_response()); echo '</pre>'; } } } ?></textarea> <p>Note: In the above code we are using a "url helper". You can find more information in the <a href="../general/helpers.html">Helpers Functions</a> page.</p> <h3>The Server</h3> <p>Using a text editor, create a controller called <dfn>xmlrpc_server.php</dfn>. In it, place this code and save it to your <samp>applications/controllers/</samp> folder:</p> <textarea class="textarea" style="width:100%" cols="50" rows="30"><?php class Xmlrpc_server extends Controller { function index() { $this->load->library('xmlrpc'); $this->load->library('xmlrpcs'); $config['functions']['Greetings'] = array('function' => 'Xmlrpc_server.process'); $this->xmlrpcs->initialize($config); $this->xmlrpcs->serve(); } function process($request) { $parameters = $request->output_parameters(); $response = array( array( 'you_said' => $parameters['0'], 'i_respond' => 'Not bad at all.'), 'struct'); return $this->xmlrpc->send_response($response); } } ?></textarea> <h3>Try it!</h3> <p>Now visit the your site using a URL similar to this:</p> <code>www.your-site.com/index.php/<var>xmlrpc_client</var>/</code> <p>You should now see the message you sent to the server, and its response back to you.</p> <p>The client you created sends a message ("How's is going?") to the server, along with a reqest for the "Greetings" method. The Server receives the request and maps it to the "process" function, where a response is sent back.</p> <p>&nbsp;</p> <h1>XML-RPC Function Reference</h1> <h2>$this->xmlrpc->server()</h2> <p>Sets the URL and port number of the server to which a request is to be sent:</p> <code>$this->xmlrpc->server('http://www.sometimes.com/pings.php', 80);</code> <h2>$this->xmlrpc->timeout()</h2> <p>Set a time out period (in seconds) after which the request will be canceled:</p> <code>$this->xmlrpc->timeout(6);</code> <h2>$this->xmlrpc->method()</h2> <p>Sets the method that will be requested from the XML-RPC server:</p> <code>$this->xmlrpc->method('<var>method</var>');</code> <p>Where <var>method</var> is the name of the method.</p> <h2>$this->xmlrpc->request()</h2> <p>Takes an array of data and builds request to be sent to XML-RPC server:</p> <code>$request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');<br /> $this->xmlrpc->request($request);</code> <h2>$this->xmlrpc->send_request()</h2> <p>The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.</p> <h2>$this->xmlrpc->set_debug(TRUE);</h2> <p>Enables debugging, which will display a variety of information and error data helpful during development.</p> <h2>$this->xmlrpc->display_error()</h2> <p>Returns an error message as a string if your request failed for some reason.</p> <code>echo $this->xmlrpc->display_error();</code> <h2>$this->xmlrpc->display_response()</h2> <p>Returns the response from the remote server once request is received. The response will typically be an associative array.</p> <code>$this->xmlrpc->display_response();</code> <h2>$this->xmlrpc->send_error_message()</h2> <p>This function lets you send an error message from your server to the client. First parameter is the error number while the second parameter is the error message.</p> <code>return $this->xmlrpc->send_error_message('123', 'Requested data not available');</code> <h2>$this->xmlrpc->send_response()</h2> <p>Lets you send the response from your server to the client. An array of valid data values must be sent with this method.</p> <code>$response = array(<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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;'flerror' => array(FALSE, 'boolean'),<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;'message' => "Thanks for the ping!")<br /> &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;&nbsp;'struct');<br /> return $this->xmlrpc->send_response($response);</code> <a name="datatypes"></a> <h2>Data Types</h2> <p>According to the <a href="http://www.xmlrpc.com/spec">XML-RPC spec</a> there are seven types of values that you can send via XML-RPC:</p> <ul> <li><em>int</em> or <em>i4</em></li> <li><em>boolean</em></li> <li><em>string</em></li> <li><em>double</em></li> <li><em>dateTime.iso8601</em></li> <li><em>base64</em></li> <li><em>struct</em> (contains array of values)</li> <li><em>array</em> (contains array of values)</li> </ul> </div> <!-- END CONTENT --> <div id="footer"> <p> Previous Topic:&nbsp;&nbsp;<a href="validation.html">Validation Class</a> &nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; <a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp; Next Topic:&nbsp;&nbsp;<a href="zip.html">Zip Encoding Class</a> </p> <p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p> </div> </body> </html> \ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+
+<title>CodeIgniter User Guide : XML-RPC and XML-RPC Server Classes</title>
+
+<style type='text/css' media='all'>@import url('../userguide.css');</style>
+<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
+
+<script type="text/javascript" src="../nav/nav.js"></script>
+<script type="text/javascript" src="../nav/prototype.lite.js"></script>
+<script type="text/javascript" src="../nav/moo.fx.js"></script>
+<script type="text/javascript" src="../nav/user_guide_menu.js"></script>
+
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv='expires' content='-1' />
+<meta http-equiv= 'pragma' content='no-cache' />
+<meta name='robots' content='all' />
+<meta name='author' content='Rick Ellis' />
+<meta name='description' content='CodeIgniter User Guide' />
+
+</head>
+<body>
+
+<!-- START NAVIGATION -->
+<div id="nav"><div id="nav_inner"><script type="text/javascript">create_menu('../');</script></div></div>
+<div id="nav2"><a name="top"></a><a href="javascript:void(0);" onclick="myHeight.toggle();"><img src="../images/nav_toggle.jpg" width="153" height="44" border="0" title="Toggle Table of Contents" alt="Toggle Table of Contents" /></a></div>
+<div id="masthead">
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
+<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
+</tr>
+</table>
+</div>
+<!-- END NAVIGATION -->
+
+
+<!-- START BREADCRUMB -->
+<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
+<tr>
+<td id="breadcrumb">
+<a href="http://www.codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
+<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
+XML-RPC and XML-RPC Server Classes
+</td>
+<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
+</tr>
+</table>
+<!-- END BREADCRUMB -->
+
+<br clear="all" />
+
+
+<!-- START CONTENT -->
+<div id="content">
+
+
+<h1>XML-RPC and XML-RPC Server Classes</h1>
+
+
+<p>CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up
+your own XML-RPC server to receive requests.</p>
+
+
+<h2>What is XML-RPC?</h2>
+
+<p>Quite simply it is a way for two computers to communicate over the internet using XML.
+One computer, which we will call the <dfn>client</dfn>, sends an XML-RPC <strong>request</strong> to
+another computer, which we will call the <dfn>server</dfn>. Once the server receives and processes the request it
+will send back a <strong>response</strong> to the client.</p>
+
+<p>For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will
+send a request to an XML-RPC Server running on your site. This request might be a new weblog entry
+being sent for publication, or it could be a request for an existing entry for editing.
+
+When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request.
+Once processed, the server will then send back a response message.</p>
+
+<p>For detailed specifications, you can visit the <a href="http://www.xmlrpc.com/">XML-RPC</a> site.</p>
+
+<h2>Initializing the Class</h2>
+
+<p>Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the <dfn>$this->load->library</dfn> function:</p>
+
+<p>To load the XML-RPC class you will use:</p>
+<code>$this->load->library('xmlrpc');</code>
+<p>Once loaded, the xml-rpc library object will be available using: <dfn>$this->xmlrpc</dfn></p>
+
+<p>To load the XML-RPC Server class you will use:</p>
+<code>
+$this->load->library('xmlrpc');<br />
+$this->load->library('xmlrpcs');
+</code>
+<p>Once loaded, the xml-rpcs library object will be available using: <dfn>$this->xmlrpcs</dfn></p>
+
+<p class="important"><strong>Note:</strong>&nbsp; When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class.</p>
+
+
+
+<h2>Sending XML-RPC Requests</h2>
+
+<p>To send a request to an XML-RPC server you must specify the following information:</p>
+
+<ul>
+<li>The URL of the server</li>
+<li>The method on the server you wish to call</li>
+<li>The <em>request</em> data (explained below).</li>
+</ul>
+
+<p>Here is a basic example that sends a simple Weblogs.com ping to the <a href="http://pingomatic.com/">Ping-o-Matic</a></p>
+
+
+<code>$this->load->library('xmlrpc');<br />
+<br />
+$this->xmlrpc->server('http://rpc.pingomatic.com/', 80);<br />
+$this->xmlrpc->method('weblogUpdates.ping');<br />
+
+<br />
+$request = array('My Photoblog', 'http://www.my-site.com/photoblog/');<br />
+$this->xmlrpc->request($request);<br />
+<br />
+if ( ! $this->xmlrpc->send_request())<br />
+{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;echo $this-&gt;xmlrpc->display_error();<br />
+}</code>
+
+<h3>Explanation</h3>
+
+<p>The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The
+request (in this case, the title and URL of your site) is placed into an array for transportation, and
+compiled using the request() function.
+Lastly, the full request is sent. If the <dfn>send_request()</dfn> method returns false we will display the error message
+sent back from the XML-RPC Server.</p>
+
+<h2>Anatomy of a Request</h2>
+
+<p>An XML-RPC <dfn>request</dfn> is simply the data you are sending to the XML-RPC server. Each piece of data in a request
+is referred to as a <dfn>request parameter</dfn>. The above example has two parameters:
+The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.</p>
+
+<p>Request parameters must be placed into an array for transportation, and each parameter can be one
+of seven data types (strings, numbers, dates, etc.). If your parameters are something other than strings
+you will have to include the data type in the request array.</p>
+
+<p>Here is an example of a simple array with three parameters:</p>
+
+<code>$request = array('John', 'Doe', 'www.some-site.com');<br />
+$this->xmlrpc->request($request);</code>
+
+<p>If you use data types other than strings, or if you have several different data types, you will place
+each parameter into its own array, with the data type in the second position:</p>
+
+<code>
+$request = array (<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('John', 'string'),<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array('Doe', 'string'),<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(FALSE, 'boolean'),<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(12345, 'int')<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);
+<br />
+$this->xmlrpc->request($request);</code>
+
+The <a href="#datatypes">Data Types</a> section below has a full list of data types.
+
+
+
+<h2>Creating an XML-RPC Server</h2>
+
+<p>An XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the
+appropriate functions for processing.</p>
+
+<p>To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming
+request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate
+class and method for processing.</p>
+
+<p>Here is an example to illustrate:</p>
+
+<code>
+$this->load->library('xmlrpc');<br />
+$this->load->library('xmlrpcs');<br />
+<br />
+$config['functions']['<var>new_post</var>']&nbsp;&nbsp;= array('function' => '<dfn>My_blog.new_entry</dfn>');<br />
+$config['functions']['<var>update_post</var>'] = array('function' => '<dfn>My_blog.update_entry</dfn>');<br />
+<br />
+$this->xmlrpcs->initialize($config);<br />
+$this->xmlrpcs->serve();</code>
+
+<p>The above example contains an array specifying two method requests that the Server allows.
+The allowed methods are on the left side of the array. When either of those are received, they will be mapped to the class and method on the right.</p>
+
+<p>In other words, if an XML-RPC Client sends a request for the <var>new_post</var> method, your
+server will load the <dfn>My_blog</dfn> class and call the <dfn>new_entry</dfn> function.
+If the request is for the <var>update_post</var> method, your
+server will load the <dfn>My_blog</dfn> class and call the <dfn>update_entry</dfn> function.</p>
+
+<p>The function names in the above example are arbitrary. You'll decide what they should be called on your server,
+or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.</p>
+
+
+<h2>Processing Server Requests</h2>
+
+<p>When the XML-RPC Server receives a request and loads the class/method for processing, it will pass
+an object to that method containing the data sent by the client.</p>
+
+<p>Using the above example, if the <var>new_post</var> method is requested, the server will expect a class
+to exist with this prototype:</p>
+
+<code>class <kbd>My_blog</kbd> extends Controller {<br />
+<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function <kbd>new_post</kbd>(<var>$request</var>)<br />
+&nbsp;&nbsp;&nbsp;&nbsp;{<br />
+ <br />
+&nbsp;&nbsp;&nbsp;&nbsp;}<br />
+}
+</code>
+
+<p>The <var>$request</var> variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client.
+Using this object you will have access to the <em>request parameters</em> enabling you to process the request. When
+you are done you will send a <dfn>Response</dfn> back to the Client.</p>
+
+<p>Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is <dfn>getUserInfo()</dfn>.
+Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends
+back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing
+function might look:</p>
+
+
+<code>class <kbd>My_blog</kbd> extends Controller {<br />
+<br />
+&nbsp;&nbsp;&nbsp;&nbsp;function <kbd>getUserInfo</kbd>(<var>$request</var>)<br />
+&nbsp;&nbsp;&nbsp;&nbsp;{<br />
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$username = 'smitty';<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$password = 'secretsmittypass';<br /><br />
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this->load->library('xmlrpc');<br />
+&nbsp;&nbsp;&nbsp;&nbsp;<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$parameters&nbsp;=&nbsp;$request->output_parameters();<br />
+&nbsp;&nbsp;&nbsp;&nbsp;<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($parameters['1'] != $username AND $parameters['2'] != $password)<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$this->xmlrpc->send_error_message('100',&nbsp;'Invalid&nbsp;Access');<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
+&nbsp;&nbsp;&nbsp;&nbsp;<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$response&nbsp;=&nbsp;array(array('nickname'&nbsp;&nbsp;=>&nbsp;array('Smitty','string'),<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;'userid'&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;array('99','string'),<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;'url'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;array('http://yoursite.com','string'),<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;'email'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=>&nbsp;array('jsmith@yoursite.com','string'),<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;'lastname'&nbsp;&nbsp;=>&nbsp;array('Smith','string'),<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;'firstname'&nbsp;=>&nbsp;array('John','string')<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;),<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;'struct');<br />
+<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return $this->xmlrpc->send_response($response);<br />
+&nbsp;&nbsp;&nbsp;&nbsp;}<br />
+}
+</code>
+
+<h3>Notes:</h3>
+<p>The <dfn>output_parameters()</dfn> function retrieves an indexed array corresponding to the request parameters sent by the client.
+In the above example, the output parameters will be the username and password.</p>
+
+<p>If the username and password sent by the client were not valid, and error message is returned using <dfn>send_error_message()</dfn>.</p>
+
+<p>If the operation was successful, the client will be sent back a response array containing the user's info.</p>
+
+
+<h2>Formatting a Response</h2>
+
+<p>Similar to <em>Requests</em>, <em>Responses</em> must be formatted as an array. However, unlike requests, a response is an array
+<strong>that contains a single item</strong>. This item can be an array with several additional arrays, but there
+can be only one primary array index. In other words, the basic prototype is this:</p>
+
+<code>$response = array('Response data', 'array');</code>
+
+<p>Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own
+array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:</p>
+
+<code>
+$response = array (<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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;'first_name' => array('John', 'string'),<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;'last_name' => array('Doe', 'string'),<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;'member_id' => array(123435, 'int'),<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;'todo_list' => array(array('clean house', 'call mom', 'water plants'), '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;),<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'struct'<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);
+</code>
+
+<p class="important">Notice that the above array is formatted as a <dfn>struct</dfn>. This is the most common data type for responses.</p>
+
+<p>As with Requests, a response can be on of the seven data types listed in the <a href="#datatypes">Data Types</a> section.</p>
+
+
+<h2>Sending an Error Response</h2>
+
+<p>If you need to send the client an error response you will use the following:</p>
+
+<code>return $this->xmlrpc->send_error_message('123', 'Requested data not available');</code>
+
+<p>The first parameter is the error number while the second parameter is the error message.</p>
+
+
+
+
+
+
+<h2>Creating Your Own Client and Server</h2>
+
+<p>To help you understand everything we've covered thus far, let's create a couple controllers that act as
+XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.</p>
+
+<h3>The Client</h3>
+
+<p>Using a text editor, create a controller called <dfn>xmlrpc_client.php</dfn>.
+In it, place this code and save it to your <samp>applications/controllers/</samp> folder:</p>
+
+<textarea class="textarea" style="width:100%" cols="50" rows="32"><?php
+
+class Xmlrpc_client extends Controller {
+
+ function index()
+ {
+ $this->load->helper('url');
+ $server_url = site_url('xmlrpc_server');
+
+ $this->load->library('xmlrpc');
+
+ $this->xmlrpc->server($server_url, 80);
+ $this->xmlrpc->method('Greetings');
+
+ $request = array('How is it going?');
+ $this->xmlrpc->request($request);
+
+ if ( ! $this->xmlrpc->send_request())
+ {
+ echo $this->xmlrpc->display_error();
+ }
+ else
+ {
+ echo '<pre>';
+ print_r($this->xmlrpc->display_response());
+ echo '</pre>';
+ }
+ }
+}
+?></textarea>
+
+<p>Note: In the above code we are using a "url helper". You can find more information in the <a href="../general/helpers.html">Helpers Functions</a> page.</p>
+
+<h3>The Server</h3>
+
+<p>Using a text editor, create a controller called <dfn>xmlrpc_server.php</dfn>.
+In it, place this code and save it to your <samp>applications/controllers/</samp> folder:</p>
+
+<textarea class="textarea" style="width:100%" cols="50" rows="30"><?php
+
+class Xmlrpc_server extends Controller {
+
+ function index()
+ {
+ $this->load->library('xmlrpc');
+ $this->load->library('xmlrpcs');
+
+ $config['functions']['Greetings'] = array('function' => 'Xmlrpc_server.process');
+
+ $this->xmlrpcs->initialize($config);
+ $this->xmlrpcs->serve();
+ }
+
+
+ function process($request)
+ {
+ $parameters = $request->output_parameters();
+
+ $response = array(
+ array(
+ 'you_said' => $parameters['0'],
+ 'i_respond' => 'Not bad at all.'),
+ 'struct');
+
+ return $this->xmlrpc->send_response($response);
+ }
+}
+?></textarea>
+
+<h3>Try it!</h3>
+
+<p>Now visit the your site using a URL similar to this:</p>
+<code>www.your-site.com/index.php/<var>xmlrpc_client</var>/</code>
+
+<p>You should now see the message you sent to the server, and its response back to you.</p>
+
+<p>The client you created sends a message ("How's is going?") to the server, along with a reqest for the "Greetings" method.
+The Server receives the request and maps it to the "process" function, where a response is sent back.</p>
+
+
+
+<p>&nbsp;</p>
+<h1>XML-RPC Function Reference</h1>
+
+<h2>$this->xmlrpc->server()</h2>
+<p>Sets the URL and port number of the server to which a request is to be sent:</p>
+<code>$this->xmlrpc->server('http://www.sometimes.com/pings.php', 80);</code>
+
+<h2>$this->xmlrpc->timeout()</h2>
+<p>Set a time out period (in seconds) after which the request will be canceled:</p>
+<code>$this->xmlrpc->timeout(6);</code>
+
+<h2>$this->xmlrpc->method()</h2>
+<p>Sets the method that will be requested from the XML-RPC server:</p>
+<code>$this->xmlrpc->method('<var>method</var>');</code>
+
+<p>Where <var>method</var> is the name of the method.</p>
+
+<h2>$this->xmlrpc->request()</h2>
+<p>Takes an array of data and builds request to be sent to XML-RPC server:</p>
+<code>$request = array(array('My Photoblog', 'string'), 'http://www.yoursite.com/photoblog/');<br />
+$this->xmlrpc->request($request);</code>
+
+<h2>$this->xmlrpc->send_request()</h2>
+<p>The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.</p>
+
+<h2>$this->xmlrpc->set_debug(TRUE);</h2>
+<p>Enables debugging, which will display a variety of information and error data helpful during development.</p>
+
+
+<h2>$this->xmlrpc->display_error()</h2>
+<p>Returns an error message as a string if your request failed for some reason.</p>
+<code>echo $this->xmlrpc->display_error();</code>
+
+<h2>$this->xmlrpc->display_response()</h2>
+<p>Returns the response from the remote server once request is received. The response will typically be an associative array.</p>
+<code>$this->xmlrpc->display_response();</code>
+
+<h2>$this->xmlrpc->send_error_message()</h2>
+<p>This function lets you send an error message from your server to the client. First parameter is the error number while the second parameter
+is the error message.</p>
+<code>return $this->xmlrpc->send_error_message('123', 'Requested data not available');</code>
+
+<h2>$this->xmlrpc->send_response()</h2>
+<p>Lets you send the response from your server to the client. An array of valid data values must be sent with this method.</p>
+<code>$response = array(<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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;'flerror' => array(FALSE, 'boolean'),<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;'message' => "Thanks for the ping!")<br />
+&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;&nbsp;'struct');<br />
+return $this->xmlrpc->send_response($response);</code>
+
+
+<a name="datatypes"></a>
+<h2>Data Types</h2>
+
+<p>According to the <a href="http://www.xmlrpc.com/spec">XML-RPC spec</a> there are seven types
+of values that you can send via XML-RPC:</p>
+
+<ul>
+<li><em>int</em> or <em>i4</em></li>
+<li><em>boolean</em></li>
+<li><em>string</em></li>
+<li><em>double</em></li>
+<li><em>dateTime.iso8601</em></li>
+<li><em>base64</em></li>
+<li><em>struct</em> (contains array of values)</li>
+<li><em>array</em> (contains array of values)</li>
+</ul>
+
+
+</div>
+<!-- END CONTENT -->
+
+
+<div id="footer">
+<p>
+Previous Topic:&nbsp;&nbsp;<a href="validation.html">Validation Class</a>
+&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
+Next Topic:&nbsp;&nbsp;<a href="zip.html">Zip Encoding Class</a>
+</p>
+<p><a href="http://www.codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2007 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
+</div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html
index 165d61b0c..a2ef6c42b 100644
--- a/user_guide/libraries/zip.html
+++ b/user_guide/libraries/zip.html
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 1.5.4</h1></td>
+<td><h1>CodeIgniter User Guide Version 1.6.0</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>