<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

    <title type="text">CodeIgniter Wiki</title>
    <subtitle type="text">CodeIgniter Wiki</subtitle>
    <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/" />
    <link rel="self" type="application/atom+xml" href="http://codeigniter.com/wiki/Special:Recentchanges_Atom" />
    <updated>2010-03-09T15:41:59Z</updated>
    <rights>Copyright (c) 2007, forums@codeigniter.com</rights>
    <generator uri="http://www.pmachine.com/" version="1.6.6">ExpressionEngine</generator>
    <id>tag:codeigniter.com,2010:03:09:wiki</id>


    <entry>
      <title>Simple Excel Plugin</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/Simple_Excel_Plugin/" />
      <id>tag:codeigniter.com,2010:wiki:Simple Excel Plugin/2129.11178</id>
      <published>2010-03-09T15:41:59Z</published>
      <updated>2010-03-09T15:41:59Z</updated>
      <author>
            <name>len kun</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <p><a href="http://codeigniter.com/wiki/Category:Plugin::Data_Conversion/" title="Category:Plugin::Data_Conversion">Category:Plugin -&gt; Data Conversion</a><br />
<a href="http://codeigniter.com/wiki/Category:Contributions::Plugins::Files/" title="Category:Contributions::Plugins::Files">Category:Contributions -&gt; Plugins -&gt; Files</a></p>

<p>This is a simple plugin to create excel output.</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php </span><span style="color: #007700">if (!</span><span style="color: #0000BB">defined</span><span style="color: #007700">(</span><span style="color: #DD0000">'BASEPATH'</span><span style="color: #007700">)) exit(</span><span style="color: #DD0000">'No direct script access allowed'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/*<br />* Excel library for Code Igniter applications<br />* Author: Federico Ramírez a.k.a fedekun a.k.a lenkun - Feb 2010<br />*/<br /><br /></span><span style="color: #007700">function </span><span style="color: #0000BB">to_excel</span><span style="color: #007700">(</span><span style="color: #0000BB">$array</span><span style="color: #007700">, </span><span style="color: #0000BB">$filename</span><span style="color: #007700">=</span><span style="color: #DD0000">'out'</span><span style="color: #007700">) </span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type: application/vnd.ms-excel'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Disposition: attachment; filename='</span><span style="color: #007700">.</span><span style="color: #0000BB">$filename</span><span style="color: #007700">.</span><span style="color: #DD0000">'.xls'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Filter all keys, they'll be table headers<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$h </span><span style="color: #007700">= array();<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$array </span><span style="color: #007700">as </span><span style="color: #0000BB">$row</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$row </span><span style="color: #007700">as </span><span style="color: #0000BB">$key</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$val</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$key</span><span style="color: #007700">, </span><span style="color: #0000BB">$h</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$h&#91;&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$key</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">'&lt;table&gt;&lt;tr&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$h </span><span style="color: #007700">as </span><span style="color: #0000BB">$key</span><span style="color: #007700">) </span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$key </span><span style="color: #007700">= </span><span style="color: #0000BB">ucwords</span><span style="color: #007700">(</span><span style="color: #0000BB">$key</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">'&lt;th&gt;'</span><span style="color: #007700">.</span><span style="color: #0000BB">$key</span><span style="color: #007700">.</span><span style="color: #DD0000">'&lt;/th&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo </span><span style="color: #DD0000">'&lt;/tr&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$array </span><span style="color: #007700">as </span><span style="color: #0000BB">$val</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">_writeRow</span><span style="color: #007700">(</span><span style="color: #0000BB">$val</span><span style="color: #007700">, </span><span style="color: #0000BB">$h</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">'&lt;/table&gt;'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">&#125;<br /><br /></span><span style="color: #007700">function </span><span style="color: #0000BB">_writeRow</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">, </span><span style="color: #0000BB">$h</span><span style="color: #007700">, </span><span style="color: #0000BB">$isHeader</span><span style="color: #007700">=</span><span style="color: #0000BB">false</span><span style="color: #007700">) </span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo </span><span style="color: #DD0000">'&lt;tr&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$h </span><span style="color: #007700">as </span><span style="color: #0000BB">$r</span><span style="color: #007700">) </span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">$isHeader</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">'&lt;th&gt;'</span><span style="color: #007700">.</span><span style="color: #0000BB">utf8_decode</span><span style="color: #007700">(@</span><span style="color: #0000BB">$row&#91;$r&#93;</span><span style="color: #007700">).</span><span style="color: #DD0000">'&lt;/th&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">'&lt;td&gt;'</span><span style="color: #007700">.</span><span style="color: #0000BB">utf8_decode</span><span style="color: #007700">(@</span><span style="color: #0000BB">$row&#91;$r&#93;</span><span style="color: #007700">).</span><span style="color: #DD0000">'&lt;/td&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo </span><span style="color: #DD0000">'&lt;/tr&gt;'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">&#125; </span>
</span>
</code></div>

<p>Example usage</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">to_excel</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">model</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getUsersAsArray</span><span style="color: #007700">()); </span>
</span>
</code></div>
      ]]></content>
    </entry>

    <entry>
      <title>MY Controller</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/MY_Controller/" />
      <id>tag:codeigniter.com,2010:wiki:MY Controller/1999.11173</id>
      <published>2010-03-08T07:15:06Z</published>
      <updated>2010-03-08T07:15:06Z</updated>
      <author>
            <name>james k</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <p><span style="color:green;">This page describes a standard feature of the CodeIgniter framework - the ability to extend core libraries.&nbsp; It concerns itself with extending <b>Controller</b> only - as this is the most common application of this feature - but the concepts shown here also apply to the other core libraries.</span></p>

<p>
</p><h2><p>
Overview
</p></h2><p>
We assume here that you have an understanding of CI and MVC fundamentals.&nbsp; You will have read through the <a href="/user_guide">User Guide</a>, especially the sections on <a href="/user_guide/general/controllers.html">Controllers</a> and <a href="/user_guide/general/models.html">Models</a>.</p>

<p>The subject of extending core controllers is discussed briefly in a few places in the manual - specifically in the <a href="http://user_guide/general/core_classes.html">Core Classes</a> and <a href="http://user_guide/general/creating_libraries.html">Creating Libraries</a> pages.</p>

<p>The <b>intent</b> of extending the core Controller is to provide methods and attributes to all your normal Controllers.&nbsp; There are other ways of providing this kind of pervasive functionality - including <a href="/user_guide/general/hooks.html">Hooks</a>, <a href="/user_guide/general/creating_libraries.html">Libraries</a> and <a href="/user_guide/general/helpers.html">Helpers</a>.&nbsp; You should familiarise yourself with the methods and benefits of those alternatives before assuming the following is <i>the</i> answer to your question.</p>

<p>Finally, it&#8217;s assumed that you have an application that does <i>something</i> - it doesn&#8217;t matter what, merely that you have an existing Controller that we can work with here.</p>



<p>
</p><h2><p>
Creating the MY_Controller file
</p></h2><p>
Extensions to the core libraries are placed in <b>application/libraries</b> and the file name is determined by adding the <b>$config[&#8216;subclass_prefix&#8217;]</b> to the core library name.</p>

<p>The $config[&#8216;subclass_prefix&#8217;] variable is set in <b>application/config/config.php</b> and by default it is set to &#8216;<b>MY_</b>&#8217;.&nbsp; You probably don&#8217;t want to change this unless you know what you&#8217;re doing (and if you know what you&#8217;re doing you&#8217;re probably not reading this guide).</p>

<p>In any case, this explains why it&#8217;s usually called the <b>MY_Controller</b> approach.</p>

<p>So, create your file - <b>application/libraries/MY_Controller.php</b> - and fill it with this code:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">class&nbsp;&nbsp;</span><span style="color: #0000BB">MY_Controller&nbsp;&nbsp;</span><span style="color: #007700">extends&nbsp;&nbsp;</span><span style="color: #0000BB">Controller&nbsp;&nbsp;&#123;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">MY_Controller </span><span style="color: #007700">()&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent</span><span style="color: #007700">::</span><span style="color: #0000BB">Controller</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#125; </span>
</span>
</code></div>

<p>Save and quit.&nbsp; Obviously this file doesn&#8217;t actually <i>do anything useful</i> but we&#8217;ll get back to that in a minute.</p>

<p>&nbsp;</p>

<p>
</p><h2><p>
Modifying your existing Controller
</p></h2>

<p>We&#8217;ll now modify one of your Controllers to work via the MY_Controller.&nbsp; The following code partial is obviously not a fully functional Controller - I&#8217;m just showing enough so you know what you have to change.&nbsp; Here we&#8217;re using the Controller <b>Forum</b>.&nbsp; CodeIgniter encourages users to stick with the PHP4 (constructor name is the same as class name) syntax, but both formats are shown here.</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #FF8000">// Consider these lines in a normal PHP5 Controller:<br /></span><span style="color: #007700">class&nbsp;&nbsp;</span><span style="color: #0000BB">Forum&nbsp;&nbsp;</span><span style="color: #007700">extends&nbsp;&nbsp;</span><span style="color: #0000BB">Controller&nbsp;&nbsp;&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function&nbsp;&nbsp;</span><span style="color: #0000BB">__construct</span><span style="color: #007700">()&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent</span><span style="color: #007700">::</span><span style="color: #0000BB">Controller</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br /><br /></span><span style="color: #FF8000">// If you are using PHP4 constructs, it will look like:<br /></span><span style="color: #007700">class&nbsp;&nbsp;</span><span style="color: #0000BB">Forum&nbsp;&nbsp;</span><span style="color: #007700">extends&nbsp;&nbsp;</span><span style="color: #0000BB">Controller&nbsp;&nbsp;&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function&nbsp;&nbsp;</span><span style="color: #0000BB">Forum</span><span style="color: #007700">()&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent</span><span style="color: #007700">::</span><span style="color: #0000BB">Controller</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125; </span>
</span>
</code></div>

<p>Now, change the relevant lines to look like this:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #FF8000">// Modify them to look like this instead (for PHP5):<br /></span><span style="color: #007700">class&nbsp;&nbsp;</span><span style="color: #0000BB">Forum&nbsp;&nbsp;</span><span style="color: #007700">extends&nbsp;&nbsp;</span><span style="color: #0000BB">MY_Controller&nbsp;&nbsp;&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function&nbsp;&nbsp;</span><span style="color: #0000BB">__construct</span><span style="color: #007700">()&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent</span><span style="color: #007700">::</span><span style="color: #0000BB">MY_Controller</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br /><br /></span><span style="color: #FF8000">// Or, for PHP4 format:<br /></span><span style="color: #007700">class&nbsp;&nbsp;</span><span style="color: #0000BB">Forum&nbsp;&nbsp;</span><span style="color: #007700">extends&nbsp;&nbsp;</span><span style="color: #0000BB">MY_Controller&nbsp;&nbsp;&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function&nbsp;&nbsp;</span><span style="color: #0000BB">Forum</span><span style="color: #007700">()&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent</span><span style="color: #007700">::</span><span style="color: #0000BB">MY_Controller</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125; </span>
</span>
</code></div>

<p>Now test your application - it will work exactly the same as it did previously.&nbsp; MY_Controller <i>is</i> being loaded - the extra processing time would be difficult to detect, so you&#8217;ll just have to trust me here.</p>

<p><i>If you don&#8217;t trust me - and good for you if so - you can edit the MY_Controller briefly and introduce an obvious syntax error, such as changing <b>parent</b> to <b>patent</b> for example, and then try reloading your page.&nbsp; Revert your error before continuing.</i></p>

<p>
</p><h3>Theory side note</h3><p>
All we&#8217;ve done here is inserted this <b>MY_Controller</b> class in between your normal Controller and the CI Controller class.&nbsp; Previously your Controller was descended directly from the CI core.&nbsp; This is basic OO theory, but if you&#8217;re not familiar with that then a ludicrous analogy might be that we&#8217;ve just inserted a new generation between you and your dad - with your dad suddenly becoming your grand-dad.&nbsp; You have still inherited the blue eyes and sparkling wit, but it means you can also now inherit (once you create them!) things from this new intermediate ancestor - such as curly hair or date formatters.</p>



<h2><p>
Putting useful stuff in MY_Controller
</p></h2>

<p>Usually people are looking for a way of making functions accessible across all their Controllers - and so we&#8217;ll make a very simple function in your <b>MY_Controller</b> to demonstrate how this can work.</p>

<p>Edit your <b>application/libraries/MY_Controller.php</b> file again, and modify it to look like this:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">class&nbsp;&nbsp;</span><span style="color: #0000BB">MY_Controller&nbsp;&nbsp;</span><span style="color: #007700">extends&nbsp;&nbsp;</span><span style="color: #0000BB">Controller&nbsp;&nbsp;&#123;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">MY_Controller </span><span style="color: #007700">()&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent</span><span style="color: #007700">::</span><span style="color: #0000BB">Controller</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Pretty date<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Takes an ISO8601 formatted date and returns a human-friendly form,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* by rounding the time to the nearest hour.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* eg. 2009-05-31T15:42:07&nbsp;&nbsp;==&gt;&nbsp;&nbsp;"2009-05-31 ~ 4pm"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param&nbsp;&nbsp;&nbsp;&nbsp;$date_in&nbsp;&nbsp;&nbsp;&nbsp;string (iso8601 date)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @return&nbsp;&nbsp;&nbsp;&nbsp;string<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function&nbsp;&nbsp;</span><span style="color: #0000BB">pretty_date </span><span style="color: #007700">( </span><span style="color: #0000BB">$date_in </span><span style="color: #007700">)&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if (</span><span style="color: #0000BB">strlen </span><span style="color: #007700">(</span><span style="color: #0000BB">$date_in</span><span style="color: #007700">) != </span><span style="color: #0000BB">19</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return </span><span style="color: #0000BB">$date_in</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// return in confusion!<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$hh </span><span style="color: #007700">= </span><span style="color: #0000BB">substr </span><span style="color: #007700">(</span><span style="color: #0000BB">$date_in</span><span style="color: #007700">, </span><span style="color: #0000BB">11</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$mm </span><span style="color: #007700">= </span><span style="color: #0000BB">substr </span><span style="color: #007700">(</span><span style="color: #0000BB">$date_in</span><span style="color: #007700">, </span><span style="color: #0000BB">14</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</span><span style="color: #0000BB">$mm </span><span style="color: #007700">&gt; </span><span style="color: #0000BB">30</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$hh</span><span style="color: #007700">++;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( (</span><span style="color: #0000BB">$hh </span><span style="color: #007700">&gt; </span><span style="color: #0000BB">23</span><span style="color: #007700">) OR (</span><span style="color: #0000BB">$hh </span><span style="color: #007700">== </span><span style="color: #DD0000">'00'</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$hh_string </span><span style="color: #007700">= </span><span style="color: #DD0000">"midnight"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</span><span style="color: #0000BB">$hh </span><span style="color: #007700">&gt; </span><span style="color: #0000BB">12</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$hh_string </span><span style="color: #007700">= (</span><span style="color: #0000BB">$hh </span><span style="color: #007700">- </span><span style="color: #0000BB">12</span><span style="color: #007700">) .</span><span style="color: #DD0000">"pm"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (</span><span style="color: #0000BB">$hh </span><span style="color: #007700">== </span><span style="color: #0000BB">12</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$hh_string </span><span style="color: #007700">= </span><span style="color: #DD0000">"midday"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$hh_string </span><span style="color: #007700">= </span><span style="color: #0000BB">$hh </span><span style="color: #007700">.</span><span style="color: #DD0000">"am"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$output </span><span style="color: #007700">= </span><span style="color: #0000BB">substr </span><span style="color: #007700">(</span><span style="color: #0000BB">$date_in</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">10</span><span style="color: #007700">) .</span><span style="color: #DD0000">" ~ "</span><span style="color: #007700">. </span><span style="color: #0000BB">$hh_string</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return </span><span style="color: #0000BB">$output</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;&nbsp;&nbsp;</span><span style="color: #FF8000">// end-function&nbsp;&nbsp;pretty_date ()<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;&nbsp;&nbsp;</span><span style="color: #FF8000">// end-class MY_Controller </span>
</span>
</code></div>

<p>
</p><h2><p>
Using a MY_Controller method from your Controller
</p></h2>

<p>The pretty_date() function above is particularly useful for ISO8601 timestamps that come in from EXIF information, for example.&nbsp; We&#8217;ll just use a hard-coded input string here.</p>

<p>Edit your functioning Controller and add in a reference to this function.&nbsp; I&#8217;ll assume you&#8217;re using $this-&gt;data for your view data, and that you have a view file you can use this in.&nbsp; You&#8217;ll see that we simply use the <b>$this-&gt;</b> prefix, which will look in the parent controller (in this case MY_Controller) for a matching method or attribute.</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #FF8000">// somewhere in one of your application's Controller files<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">...<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">data&#91;</span><span style="color: #DD0000">'friendly_date'</span><span style="color: #0000BB">&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">pretty_date </span><span style="color: #007700">(</span><span style="color: #DD0000">"2009-05-31T16:42:07"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;...<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">view </span><span style="color: #007700">(</span><span style="color: #DD0000">'your_view'</span><span style="color: #007700">, </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">data</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;... </span>
</span>
</code></div>

<p>In your view you can now <b>echo $friendly_date</b> - so go and make that change to your view file and then reload your web page to confirm that it&#8217;s all tickety-boo.</p>

<p>Impressive, eh?</p>

<p>&nbsp;</p>

<h2><p>
Final notes on this method
</p></h2>

<p>This is a fairly trivial example of what you can do with MY_Controller - most people would put a function like pretty_date() into a helper, as it requires no database access, and is only needed for views that have to generate a pretty date from an ISO8601 one.</p>

<p>More often you would use a MY_Controller for &#8216;on-every-page-load&#8217; activities like:<br />
 <b>o</b> calling models to retrieve database information,<br />
 <b>o</b> setting / retrieving Session data,<br />
 <b>o</b> applying an authentication layer - often tied in with Session data,<br />
 <b>o</b> generating <a href="http://www.designerevaluation.com/web-design/">Web Design</a> <a href="http://www.designerevaluation.com/logo-design/">Logo Design</a> common view partials (headers, footers, menus).</p>

<p>As an example of the last one there, have a read of Jedd&#8217;s <a href="/wiki/Header_and_Footer_and_Menu_on_every_page_-_jedd/">header, footer and menu on every page</a> article.
</p>
      ]]></content>
    </entry>

    <entry>
      <title>SPAW</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/SPAW/" />
      <id>tag:codeigniter.com,2010:wiki:SPAW/665.11172</id>
      <published>2010-03-08T07:13:11Z</published>
      <updated>2010-03-08T07:13:11Z</updated>
      <author>
            <name>james k</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <p><a href="http://codeigniter.com/wiki/Category:Library::External/" title="Category:Library::External">Category:Library -&gt; External</a> | <a href="http://codeigniter.com/wiki/Category:Library::WYSIWYG/" title="Category:Library::WYSIWYG">Category:Library -&gt; WYSIWYG</a>
</p><h2>Introduction</h2><p>
SPAW is a very powerful and easy to use visual editor that I like to use in my applications.</p>

<p>I wanted to keep it flowing with the rest of my CI app by using the loader class to load it (instead of including it at strange places in my views), so I turned it into a custom library which can be loaded.
</p><h2>Dowload</h2><p>
<a href="http://codeigniter.com/wiki/File:spaw2.zip/" title="File:spaw2.zip" class="noArticle">File:spaw2.zip</a></p>

<h2>Installation</h2><p>
Download the spaw2.zip file and unzip its contents into your libraries directory within your CI app. </p>

<p>Move the spaw.php file within the spaw2 directory into the libraries directory.</p>

<p><i>Note: as of CodeIgniter_1.5.3 the loader class cannot recurse directory structures in the libraries directory, spaw.php needs to be directly inside it.</i></p>

<p>Then, inside your controller do something like this:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">class </span><span style="color: #0000BB">Test </span><span style="color: #007700">extends </span><span style="color: #0000BB">Controller<br />&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">Test</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;parent</span><span style="color: #007700">::</span><span style="color: #0000BB">Controller</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$config&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">= array(</span><span style="color: #DD0000">'name'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'SpawTest'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'content'&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'This should be in textarea.'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">library</span><span style="color: #007700">(</span><span style="color: #DD0000">'spaw'</span><span style="color: #007700">, </span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">index</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">view</span><span style="color: #007700">(</span><span style="color: #DD0000">'test_view'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&#125; </span>
</span>
</code></div>

<p>Notice &#8216;spaw&#8217; is the name of the spaw.php library file the instance of the editor is loaded from there; and $config is the parameter array for the editor.</p>

<p>The $config array, the &#8216;name&#8217; key holds the value for the name of the SPAW instance, and the &#8216;content&#8217; key holds the value for the textarea (the text that shows up by default before the user does any input).</p>

<p>Now, to actually load the editor into the browser window, I chose to call it in my view like so:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">&lt;</span><span style="color: #0000BB">html</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">head</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">title</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Test </span><span style="color: #007700">for </span><span style="color: #0000BB">SPAW LIBRARY</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">title</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">head</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">body</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">&lt;?</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">spaw</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">show</span><span style="color: #007700">();</span><span style="color: #0000BB">?&gt;<br /></span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">body</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">html</span><span style="color: #007700">&gt; </span>
</span>
</code></div>

<p>$this-&gt;spaw-&gt;show() is what does the magic.</p>

<p>There are many, many other configurable options (width, height, stylehseet to use, toolbar config, etc) and can be set with SPAW&#8217;s default static methods. Just remember to replace </p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$spaw</span><span style="color: #007700">-&gt; </span>
</span>
</code></div> with <div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">spaw </span>
</span>
</code></div>

<p>This integration is not exhaustive and I am releasing this under the same license the software came with.
</p><h2>Links</h2><p>
<a href="http://www.eluneart.com">Web design company</a> <a href="http://www.realdissertationwriting.com/">Dissertation</a> <a href="http://www.realessaywriting.com/">Essay</a> <a href="http://www.realthesiswriting.com/">Thesis</a> <a href="http://www.realassignmentwriting.com/">Assignment</a><br />
<a href="http://codeigniter.com/forums/viewthread/53053/">Forum thread</a><br />
<a href="http://www.spaweditor.com/spaw/spaw2/docs/documentation/integrators.html">SPAW documentation</a> (needed!)
</p>
      ]]></content>
    </entry>

    <entry>
      <title>Category:Help &#45;&gt; Tutorials</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/Category:Help::Tutorials/" />
      <id>tag:codeigniter.com,2010:wiki:Category:Help &#45;&gt; Tutorials/1380.11171</id>
      <published>2010-03-08T00:32:46Z</published>
      <updated>2010-03-08T00:32:46Z</updated>
      <author>
            <name>pfortune</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <h4>Official video tutorials</h4><p>
* <a href="http://codeigniter.com/tutorials/watch/intro/">Hello World! Introduction to Code Igniter</a><br />
* <a href="http://codeigniter.com/tutorials/watch/blog/">Create a Blog in 20 Minutes</a></p>

<h4>Video tutorials on external sites</h4><p>
* <a href="http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-1/">Jeffrey Way&#8217;s CodeIgniter From Scratch: Day 1, Nettuts.com - Getting Started With the Framework</a><br />
* <a href="http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-2/">Jeffrey Way&#8217;s CodeIgniter From Scratch: Day 2, Nettuts.com - Database Selecting Methods</a><br />
* <a href="http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-3/">Jeffrey Way&#8217;s CodeIgniter From Scratch: Day 3, Nettuts.com - Sending Emails</a><br />
* <a href="http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-4/">Jeffrey Way&#8217;s CodeIgniter From Scratch: Day 4, Nettuts.com - Newsletter Signup</a><br />
* <a href="http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-5/">Jeffrey Way&#8217;s CodeIgniter From Scratch: Day 5, Nettuts.com - CRUD</a><br />
* <a href="http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-6/">Jeffrey Way&#8217;s CodeIgniter From Scratch: Day 6, Nettuts.com - Login</a><br />
* <a href="http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-7-pagination/">Jeffrey Way&#8217;s CodeIgniter From Scratch: Day 7, Nettuts.com - Pagination</a><br />
* <a href="http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-day-8-ajax/">Burak Guzel&#8217;s CodeIgniter From Scratch: Day 8, Nettuts.com – AJAX</a>(Burak, we&#8217;ll be continuing the series!) <br />
* <a href="http://video.derekallard.com/">Derek Allard&#8217;s Tutorial using AJAX, Scriptaculous, and Models</a><br />
* <a href="http://binarycake.com/authors/elliot-haughin/">Elliot Haughin&#8217;s CI Screencasts (Pay to view)</a> Includes three CodeIgniter screencasts.<br />
* <a href="http://www.revver.com/video/366983/ignited-the-screencast-configuration/">Michael Wales&#8217; Ignited: The Screencast</a> - Episode 1: Configuration<br />
* <a href="http://www.viddler.com/explore/lszanto/videos/1/">Image Uploader Tutorial</a> hosted at Viddler.com, created by <a href="http://codeigniter.com/forums/member/52992/">Iszanto</a> (2007-10-31)<br />
*<a href="http://jedidiahreeser.com/blog/2009/07/accessing-multiple-databases-codeigniter/">Jedidiah Reeser&#8217;s - Accessing Multiple Databases</a> (2009-07)<br />
*<a href="http://designerfoo.com/codeigniter-tutorial-tellafriend-email-form-validation-codeignter.html#contentstartshere">Designerfoo.com: CI TellAFriend Video Tutorial</a>&nbsp; - By Manoj Sachwani (2010-01-03)<br />
* <a href="http://www.youtube.com/verbloten">Alasdair Boyd&#8217;s Series of CodeIgniter Video Tutorials</a><br />
*<a href="http://shawnmccool.com/2009/08/29/understand-the-structure-of-code-igniter/">Shawn McCool&#8217;s Blog - Code Igniter: An Incredibly Brief Introduction</a><br />
*<a href="http://shawnmccool.com/2009/09/04/developing-a-website-with-code-igniter-part-1-configuration/">Shawn McCool&#8217;s Blog - Developing a website with Code Igniter Part 1: Configuration</a><br />
*<a href="http://shawnmccool.com/2009/09/06/developing-a-website-with-code-igniter-part-2-users-database-table-and-the-user-model/">Shawn McCool&#8217;s Blog - Developing a website with Code Igniter Part 2: Users database table and users model</a><br />
*<a href="http://shawnmccool.com/2009/11/09/developing-a-website-with-code-igniter-part-3-the-login-process/">Shawn McCool&#8217;s Blog - Developing a website with Code Igniter Part 3: The Login Process</a><br />
*<a href="http://shawnmccool.com/2010/01/30/developing-a-website-with-codeigniter-part-4-admin-site-crud/">Shawn McCool&#8217;s Blog - Developing a website with Code Igniter Part 4: Admin Site Crud</a></p>

<p>
</p><h4>Written tutorials on external sites</h4><p>
* <a href="http://4moki.com/ajax-login-with-jquery-and-codeigniter/">Ajax login with Jquery and Codeigniter</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup">CodeIgniter and Doctrine from scratch. Day 1 – Install and Setup.</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-and-doctrine-from-scratch-day-2-the-basics">CodeIgniter and Doctrine from scratch. Day 2 – The Basics.</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-scratch-day-3-user-signup-form">CodeIgniter and Doctrine from scratch. Day 3 – User Signup Form.</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-scratch-day-4-user-login">CodeIgniter and Doctrine from scratch. Day 4 – User Login.</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-day-5-database-crud">CodeIgniter and Doctrine from scratch. Day 5 – Database CRUD.</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-day-6-models-relationships">CodeIgniter and Doctrine from scratch. Day 6 - Models with Relationships</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-scratch-day-7-fixtures-forum-list">CodeIgniter and Doctrine from scratch. Day 7 - Fixtures &amp; Forum List</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-scratch-day-8-hooks-profiling-dql">CodeIgniter and Doctrine from scratch. Day 8 - Hooks, Profiling and DQL</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-scratch-day-9-templates-data-hydrators">CodeIgniter and Doctrine from scratch. Day 9 - Templates &amp; Data Hydrators</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-scratch-day-10-pagination">CodeIgniter and Doctrine from scratch. Day 10 - Pagination</a><br />
* <a href="http://www.phpandstuff.com/articles/codeigniter-doctrine-scratch-day-11-record-hooks">CodeIgniter and Doctrine from scratch. Day 11 - Record Hooks</a></p>

<p>* <a href="http://henrihnr.wordpress.com/2009/04/26/simple-crud-application/">Henri Blog - Simple CRUD – CodeIgniter</a></p>

<p>* <a href="http://www.devshed.com/c/a/PHP/Introduction-to-the-CodeIgniter-PHP-Framework/">Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 1</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Building-a-DatabaseDriven-Application-with-the-Code-Igniter-PHP-Framework/">Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 2 - Databases</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Paginating-Database-Records-with-the-Code-Igniter-PHP-Framework/">Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 3 - Paginating</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Validating-Web-Forms-with-the-Code-Igniter-PHP-Framework/">Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 4 - Validating</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Performing-Strict-Validation-with-the-Code-Igniter-PHP-Framework/">Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 5 - Strict Validating</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Working-with-the-Active-Record-Class-in-Code-Igniter/">Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 6 - Active Record</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Inserting-Updating-and-Deleting-Database-Rows-with-Code-Igniter/">Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 7 - Insert/Update/Delete Database Rows</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Working-with-the-Email-Class-in-Code-Igniter/">Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 8 - Emailing</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Building-a-Content-Management-System-with-Code-Igniter/">Devshed: Introduction-to-the-CodeIgniter-PHP-Framework - Part 9 - Build a CMS</a></p>

<p>* <a href="http://www.devshed.com/c/a/PHP/Handling-Views-with-CodeIgniter/">Devshed: Handling-Views-with-CodeIgniter - Part 1</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Adding-CSS-to-Handling-Views-with-CodeIgniter/">Devshed: Handling-Views-with-CodeIgniter - Part 2 - Adding CSS</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Using-Nested-Views-with-CodeIgniter/">Devshed: Handling-Views-with-CodeIgniter - Part 3 - Using nested views</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Returning-Strings-from-Views-with-Code-Igniter/">Devshed: Handling-Views-with-CodeIgniter - Part 4 - Returning Strings from Views</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Moving-Presentation-Logic-Out-of-Views-with-Code-Igniter/">Devshed: Handling-Views-with-CodeIgniter - Part 5 - Moving Presentation Logic out of Views</a><br />
* <a href="http://www.devshed.com/c/a/PHP/Defining-a-Model-Class-for-Handling-Views-with-CodeIgniter/">Devshed: Handling-Views-with-CodeIgniter - Part 6 - Models and Views </a><br />
* <a href="http://www.devshed.com/c/a/PHP/Embedding-Model-Data-in-Views-with-Code-Igniter/">Devshed: Handling-Views-with-CodeIgniter - Part 7 - Model Data and Views</a></p>

<p>* <a href="http://pinoytech.org/blog/post/AJAX-with-CodeIgniter">PinoyTech - AJAX with CodeIgniter</a><br />
* <a href="http://pinoytech.org/blog/post/pagination-with-codeigniter">PinoyTech - Pagination with CodeIgniter</a><br />
* <a href="http://pinoytech.org/blog/post/CodeIgniter-Image-Manipulation-Class-How-to-Resize">PinoyTech - CodeIgniter Image Manipulation Class: How to Resize</a></p>

<p>* <a href="http://godbit.com/article/introduction-to-code-igniter">Godbit Project - Introduction to Code Igniter: Part 1</a><br />
* <a href="http://godbit.com/article/introduction-to-code-igniter-part-2">Godbit Project - Introduction to Code Igniter: Part 2</a><br />
* <a href="http://godbit.com/article/introduction-to-code-igniter-part-3">Godbit Project - Introduction to Code Igniter: Part 3</a><br />
* <a href="http://godbit.com/article/pagination-with-code-igniter">Godbit Project - Pagination with Code Igniter</a></p>

<p>* <a href="http://www.4webby.com/freakauth/tutorials/ci-swift-mailer">4webby.com - Using SWIFT MAILER with Code Igniter</a><br />
* <a href="http://www.4webby.com/freakauth/tutorials/using-zend-framework-components-in-code-igniter">4webby.com - Using Zend Framework components in Code Igniter</a><br />
* <a href="http://www.derekallard.com/blog/post/building-an-rss-feed-in-code-igniter/">Building an RSS Feed in Code Igniter</a></p>

<p>* <a href="http://pr0digy.com/codeigniter/unobtrusive-ajax-with-codeigniter-and-mootools/">pr0digy.com - Unobtrusive AJAX with CodeIgniter and Mootools</a><br />
* <a href="http://pr0digy.com/codeigniter/live-search-with-codeigniter-and-mootools/">pr0digy.com - Live search with CodeIgniter and Mootools (JSON)</a></p>

<p>* <a href="http://www.zenperfect.com/2007/07/12/model-view-controller-and-codeigniter/"> zenperfect - Introduction to MVC Approach</a><br />
* <a href="http://www.zenperfect.com/2007/07/27/sample-codeigniter-application/"> zenperfect - Sample Application with Source Code</a><br />
shows Ajax with Prototype and script.aculo.us, models, sessions</p>

<p>* <a href="http://www.devshed.com/c/a/PHP/Introduction-to-the-CodeIgniter-PHP-Framework/">devshed - Introduction to the CodeIgniter Framework Part 1</a></p>

<p>* <a href="http://www.ibm.com/developerworks/web/library/wa-codeigniter/index.html">IBM developerWorks - Getting started with CodeIgniter</a></p>

<p>* <a href="http://lazarevskizoran.com/blog"> Helpful tutorials for CodeIgniter beginners and some helpful techniques </a></p>

<p>* <a href="http://www.kromack.com/codeigniter/tutorial-codeigniter-flashdata-highlighting-with-jquery-and-jgrowl/">CodeIgniter Flashdata Highlighting with jQuery and jGrowl</a></p>

<h4>Portuguese</h4>

<p>* <a href="http://programadoranonimo.blogspot.com/2008/10/tutorial-mvc-1-introduo.html">Programador Anónimo(PT)-Tutorial MVC - 1 Introdução</a><br />
* <a href="http://programadoranonimo.blogspot.com/2008/10/tutorial-mvc-2-codeigniter-primeiros.html">Programador Anónimo(PT)-Tutorial MVC - 2 CodeIgniter, Primeiros Passos</a><br />
* <a href="http://programadoranonimo.blogspot.com/2008/10/tutorial-mvc-3-acesso-dados.html">Programador Anónimo(PT)-Tutorial MVC - 3 Acesso a dados</a><br />
* <a href="http://programadoranonimo.blogspot.com/2008/10/tutorial-mvc-4-inserir-de-dados.html">Programador Anónimo(PT)-Tutorial MVC - 4 Inserir dados, Formulários e Validação</a></p>

<h4>French</h4>

<p>* <a href="http://www.kromack.com/codeigniter/tutoriel-codeigniter-creer-ses-propres-fichiers-de-configuration/">Créer et gérer ses propres fichiers de configuration</a></p>

<p>* <a href="http://www.kromack.com/codeigniter/bonnes-pratiques-sur-la-gestion-de-base-de-donnees-sous-codeigniter/">Bonnes pratiques sur la gestion de bases de données sous CodeIgniter</a></p>

<h4>Spanish</h4>

<p>* <a href="http://www.davidrojas.net/index.php/desarrollo-web/screencast-introduccion-al-framework-php-codeigniter/">David Rojas&#8217; Videotutorial: Introducción a Codeigniter</a><br />
* <a href="http://www.davidrojas.net/index.php/desarrollo-web/screencast-tutorial-creacion-y-validacion-de-formularios-con-codeigniter/">David Rojas&#8217; Videotutorial: Creación y validación de formularios con Codeigniter</a><br />
* <a href="http://www.davidrojas.net/index.php/desarrollo-web/screencast-tutorial-ajax-con-jquery-en-codeigniter/">David Rojas&#8217; Videotutorial: Ajax con Jquery en Codeigniter</a><br />
* <a href="http://www.davidrojas.net/index.php/desarrollo-web/screencast-crud-con-scaffolding-rendimiento-y-unit-testing-en-codeigniter/">David Rojas&#8217; Videotutorial: CRUD con scaffolding, rendimiento y unit testing en Codeigniter</a><br />
* <a href="http://www.davidrojas.net/index.php/desarrollo-web/screencast-tutorial-hooks-y-creacion-de-librerias-con-codeigniter/">David Rojas&#8217; Videotutorial: Hooks y creación de librerías con Codeigniter</a></p>

<h4>Other</h4>

<p>* Norwegian: <a href="http://www.skitx.com/artikkel/kom_igang_med_codeigniter/">Kom igang med CodeIgniter</a></p>

<h3>All CodeIgniter resources in 1 place:</h3><p>
<a href="http://www.codeigniterdirectory.com/">www.codeigniterdirectory.com</a>
</p>
      ]]></content>
    </entry>

    <entry>
      <title>HTML Table Library helper extension</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/HTML_Table_Library_helper_extension/" />
      <id>tag:codeigniter.com,2010:wiki:HTML Table Library helper extension/2158.11168</id>
      <published>2010-03-06T23:51:46Z</published>
      <updated>2010-03-06T23:51:46Z</updated>
      <author>
            <name>milosh</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <p><a href="http://codeigniter.com/wiki/Category:Contributions::Libraries::Table/" title="Category:Contributions::Libraries::Table">Category:Contributions -&gt; Libraries -&gt; Table</a><br />
Here is a little extension that I wrote to table library, with the following functions</p>

<p>add_column &lt;- works similarly to add_row, but adds column <br />
transpose &lt;- transposes a table (rows become columns and columns become rows)<br />
remove_column &lt;- removes column<br />
add_anchor &lt;- adds an anchor to the table.</p>

<p>I wrote it mainly because I wanted to have a simple method to add links to each row of  table, which has been built from database query. This works now with two commands:</p>

<p>$this-&gt;table-&gt;add_anchor($id_column_name, $value_column_name, $path);<br />
$this-&gt;table-&gt;remove_column($id_column_name);</p>

<p>Usage examples:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add_row</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'John'</span><span style="color: #007700">, </span><span style="color: #DD0000">'red'</span><span style="color: #007700">, </span><span style="color: #DD0000">'small'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add_row</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'Mary'</span><span style="color: #007700">, </span><span style="color: #DD0000">'blue'</span><span style="color: #007700">, </span><span style="color: #DD0000">'medium'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add_row</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'Jim'</span><span style="color: #007700">, </span><span style="color: #DD0000">'green'</span><span style="color: #007700">, </span><span style="color: #DD0000">'large'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add_row</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'Peter'</span><span style="color: #007700">, </span><span style="color: #DD0000">'black'</span><span style="color: #007700">, </span><span style="color: #DD0000">'unknown'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">set_heading</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">, </span><span style="color: #DD0000">'colour'</span><span style="color: #007700">, </span><span style="color: #DD0000">'size'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">"--------------"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Add some columns. Note that you can either add a column as array or as list<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// If table heading is set, then the first name is assumed to be heading. <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add_column</span><span style="color: #007700">(</span><span style="color: #DD0000">'availability'</span><span style="color: #007700">, </span><span style="color: #DD0000">'free'</span><span style="color: #007700">, </span><span style="color: #DD0000">'unavailable'</span><span style="color: #007700">, </span><span style="color: #DD0000">'available'</span><span style="color: #007700">, </span><span style="color: #DD0000">'later'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add_column</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'another'</span><span style="color: #007700">, </span><span style="color: #DD0000">'first'</span><span style="color: #007700">, </span><span style="color: #DD0000">'second'</span><span style="color: #007700">, </span><span style="color: #DD0000">'third'</span><span style="color: #007700">, </span><span style="color: #DD0000">'fourth'</span><span style="color: #007700">)); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">"--------------"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Create a link for "size" column on each row that links to path "part/delete/$name"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// The search is done by the name of the column, so be aware of case sensitivity<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// The function below adds a link &lt;a href="http://www.example.com/index.php/part/delete/$name"&gt;$size&lt;/a&gt; to each row of the "size" column. <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// the function syntax is add_anchor($id_value_colum_name, $value_column_name, $path)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add_anchor</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">, </span><span style="color: #DD0000">'size'</span><span style="color: #007700">, </span><span style="color: #DD0000">'part/delete'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">"--------------"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Now hide the "name" column. Note that links are still working.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Note that this gives you a nice way to build links from database query ID columns<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// and hide ID columns from viewing. :)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">remove_column</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">"--------------"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Transpose a table<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">transpose</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">table</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">generate</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo </span><span style="color: #DD0000">"--------------"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt; </span>
</span>
</code></div><p>
The code to add into your Library folder:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php <br /></span><span style="color: #FF8000">/**<br /> * Some helpers<br /> * <br /> * add_column<br /> * remove_colum<br /> * add_anchor($id_column_name, $value_column_name, $path)<br /> * transpose<br /> * <br /> *<br /> */<br /></span><span style="color: #007700">Class </span><span style="color: #0000BB">MY_Table </span><span style="color: #007700">extends </span><span style="color: #0000BB">CI_Table &#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;public $columns</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Transpose array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @param $array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @return array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;/**<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* Add column to table <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* @return unknown_type<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">add_column</span><span style="color: #007700">()</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Is heading empty?<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if (empty(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading</span><span style="color: #007700">))</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// no heading yet<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$columns </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_flip</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$args </span><span style="color: #007700">= </span><span style="color: #0000BB">func_get_args</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$columns&#91;&#93; </span><span style="color: #007700">= (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$args&#91;0&#93;</span><span style="color: #007700">)) ? </span><span style="color: #0000BB">$args&#91;0&#93; </span><span style="color: #007700">: </span><span style="color: #0000BB">$args</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_flip</span><span style="color: #007700">(</span><span style="color: #0000BB">$columns</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">else </span><span style="color: #0000BB">&#123; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Assume that the first element is heading<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$args </span><span style="color: #007700">= </span><span style="color: #0000BB">func_get_args</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$col </span><span style="color: #007700">= (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$args&#91;0&#93;</span><span style="color: #007700">)) ? </span><span style="color: #0000BB">$args&#91;0&#93; </span><span style="color: #007700">: </span><span style="color: #0000BB">$args</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$heading </span><span style="color: #007700">= </span><span style="color: #0000BB">array_shift</span><span style="color: #007700">(</span><span style="color: #0000BB">$col</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// add columns...<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$columns </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_flip</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$columns&#91;&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$col</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_flip</span><span style="color: #007700">(</span><span style="color: #0000BB">$columns</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// ...and heading<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading&#91;&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$heading</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Remove column from table<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">remove_column</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">)</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(empty(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key </span><span style="color: #007700">= </span><span style="color: #0000BB">array_search</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">, </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$columns </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_flip</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset(</span><span style="color: #0000BB">$columns&#91;$key&#93;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading&#91;$key&#93;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_flip</span><span style="color: #007700">(</span><span style="color: #0000BB">$columns</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Transpose table<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">transpose</span><span style="color: #007700">()</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if (!empty(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading </span><span style="color: #007700">= array(); </span><span style="color: #FF8000">// Empty heading<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_flip</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">// Create anchor for table row<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">function </span><span style="color: #0000BB">add_anchor</span><span style="color: #007700">(</span><span style="color: #0000BB">$id_column</span><span style="color: #007700">, </span><span style="color: #0000BB">$value_column</span><span style="color: #007700">, </span><span style="color: #0000BB">$path</span><span style="color: #007700">)</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$CI </span><span style="color: #007700">= &amp; </span><span style="color: #0000BB">get_instance</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">helper</span><span style="color: #007700">(</span><span style="color: #DD0000">'url'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (empty(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$id_key </span><span style="color: #007700">= </span><span style="color: #0000BB">array_search</span><span style="color: #007700">(</span><span style="color: #0000BB">$id_column</span><span style="color: #007700">, </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$val_key </span><span style="color: #007700">= </span><span style="color: #0000BB">array_search</span><span style="color: #007700">(</span><span style="color: #0000BB">$value_column</span><span style="color: #007700">, </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">heading</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach (</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows </span><span style="color: #007700">as </span><span style="color: #0000BB">$key </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$var</span><span style="color: #007700">) </span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows&#91;$key&#93;&#91;$val_key&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_add_anchor</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows&#91;$key&#93;&#91;$val_key&#93;</span><span style="color: #007700">, </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rows&#91;$key&#93;&#91;$id_key&#93;</span><span style="color: #007700">, </span><span style="color: #0000BB">$path</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;private </span><span style="color: #007700">function </span><span style="color: #0000BB">_add_anchor</span><span style="color: #007700">(</span><span style="color: #0000BB">$value</span><span style="color: #007700">, </span><span style="color: #0000BB">$id</span><span style="color: #007700">, </span><span style="color: #0000BB">$path</span><span style="color: #007700">)</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">return </span><span style="color: #0000BB">anchor</span><span style="color: #007700">(</span><span style="color: #0000BB">$path</span><span style="color: #007700">. </span><span style="color: #DD0000">"/" </span><span style="color: #007700">.</span><span style="color: #0000BB">$id</span><span style="color: #007700">, </span><span style="color: #0000BB">$value</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;private </span><span style="color: #007700">function </span><span style="color: #0000BB">_flip</span><span style="color: #007700">(</span><span style="color: #0000BB">$array</span><span style="color: #007700">)</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$flipped </span><span style="color: #007700">= array();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach (</span><span style="color: #0000BB">$array </span><span style="color: #007700">as </span><span style="color: #0000BB">$key </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$subarray</span><span style="color: #007700">)</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">foreach (</span><span style="color: #0000BB">$subarray </span><span style="color: #007700">as </span><span style="color: #0000BB">$subkey </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$subvar</span><span style="color: #007700">) </span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$flipped&#91;$subkey&#93;&#91;$key&#93; </span><span style="color: #007700">= </span><span style="color: #0000BB">$subvar</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">return </span><span style="color: #0000BB">$flipped</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&#125; </span>
</span>
</code></div>
      ]]></content>
    </entry>

    <entry>
      <title>tellafriend</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/tellafriend/" />
      <id>tag:codeigniter.com,2010:wiki:tellafriend/2156.11161</id>
      <published>2010-03-06T13:16:57Z</published>
      <updated>2010-03-06T13:16:57Z</updated>
      <author>
            <name>kierownik</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <p>I wrote a simple tell a friend script I want to share with all of you.</p>

<p>In the download you find an sql file, you have to import that in your database using phpmyadmin or something.</p>

<p>1. Set the correct database items and you are almost ready to go.</p>

<p>2. Go to tellafriend.php in the config folder and set your config settings.</p>

<p>3. After that you go to the folder &#8216;lang/english&#8217; and change the lang items to your liking.</p>

<p>4. Save and close and you are ready to go.</p>

<p>If you are having problems with the script you can reply at the forums that is found here: <a href="http://codeigniter.com/forums/viewthread/146324/">http://codeigniter.com/forums/viewthread/146324/</a>.</p>

<p><a href="http://codeigniter.com/wiki/File:tellafriend.zip/" title="File:tellafriend.zip" class="noArticle">File:tellafriend.zip</a> &lt;= database tell a friend script<br />
Coming up is one that does not use a database.
</p>
      ]]></content>
    </entry>

    <entry>
      <title>Language Translation</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/Language_Translation/" />
      <id>tag:codeigniter.com,2010:wiki:Language Translation/471.11157</id>
      <published>2010-03-06T12:45:35Z</published>
      <updated>2010-03-06T12:45:35Z</updated>
      <author>
            <name>rogcode</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <p><a href="http://codeigniter.com/wiki/Category:Core::Language_Files/" title="Category:Core::Language_Files">Category:Core -&gt; Language Files</a></p>

<h3>User Guide Translations</h3><p>
<strong>Spanish</strong> User Guide (1.6.3) in both PDF &amp; HTML - <a href="http://www.conocimientovirtual.edu.co/descargas.html">http://www.conocimientovirtual.edu.co/descargas.html</a><br />
<img src="http://codeigniter.org.cn/images/china.gif"  alt='China Flag' /> <strong>Chinese</strong> User Guide (1.7.2) in HTML(Wiki) - <a href="http://codeigniter.org.cn/user_guide">http://codeigniter.org.cn/user_guide</a><br />
<strong>Russian</strong> User Guide (1.6.3) in HTML — <a href="http://code-igniter.ru/">http://code-igniter.ru/</a><br />
<strong>Turkish</strong> User Guide (1.6.3) in HTML <a href="http://www.codeigniter.gen.tr/user_guide">http://www.codeigniter.gen.tr/user_guide</a><br />
<strong>German</strong> User Guide (1.7.1) in HTML <a href="http://codeigniter.ch/user_guide">http://codeigniter.ch/user_guide</a></p>

<h3>Language Packs</h3>

<p>See also the page <a href="http://codeigniter.com/wiki/Category:Contributions::Languages/" title="Category:Contributions::Languages">Category:Contributions -&gt; Languages</a> for other language packs.</p>

<h4>[1.7.2]</h4><p>
- BASQUE <a href="http://codeigniter.com/wiki/File:basque_1.7.2.zip/" title="File:basque_1.7.2.zip" class="noArticle">File:basque 1.7.2.zip</a> (Ander Goñi, Danobat Group)<br />
- DUTCH <a href="http://codeigniter.com/wiki/File:dutch.zip/" title="File:dutch.zip" class="noArticle">File:dutch.zip</a> (Magnatron), <a href="http://codeigniter.com/wiki/File:1.7.2_dutch_magnatron_tomcode.zip/" title="File:1.7.2_dutch_magnatron_tomcode.zip" class="noArticle">File:1.7.2 dutch magnatron tomcode.zip</a> (2 fixes and masking)<br />
- FRENCH <a href="http://codeigniter.com/wiki/File:french_1.7.2.zip/" title="File:french_1.7.2.zip" class="noArticle">File:french 1.7.2.zip</a> (Caribou)<br />
- GERMAN <a href="/wiki/File:1.7.2_german_slackero.zip/">1.7.2_german_slackero.zip</a> (tomcode, slackero)<br />
- KOREAN <a href="http://codeigniter.com/wiki/File:korean.1.7.2.zip/" title="File:korean.1.7.2.zip" class="noArticle">File:korean.1.7.2.zip</a> (corean)<br />
- POLISH <a href="http://www.sinsoft.pl/files/codeigniter-1.7.2-polish-utf8.zip">http://www.sinsoft.pl/files/codeigniter-1.7.2-polish-utf8.zip</a> (sinsoft)<br />
- SPANISH <a href="http://codeigniter.com/wiki/File:spanish_1.7.2.zip/" title="File:spanish_1.7.2.zip" class="noArticle">File:spanish 1.7.2.zip</a> (Miguel Herrero, Ivan Argulo)<br />
- CATALAN <a href="http://codeigniter.com/wiki/File:catalan_1.7.2.zip/" title="File:catalan_1.7.2.zip" class="noArticle">File:catalan 1.7.2.zip</a> (Adri&agrave; Bayona i Roger Bernaus)</p>

<h4>[1.7.0 - 1.7.1]</h4><p>
- CHINESE SIMPLIFIED <a href="http://codeigniter.com/wiki/File:chinese_simplified_1.7.0.zip/" title="File:chinese_simplified_1.7.0.zip" class="noArticle">File:chinese simplified 1.7.0.zip</a> (Lucas Lee)</p>

<p>- CHINESE TRADITIONAL <a href="http://codeigniter.com/wiki/File:chinese_traditional_1.7.2.zip/" title="File:chinese_traditional_1.7.2.zip" class="noArticle">File:chinese traditional 1.7.2.zip</a> (achi)</p>

<p>- CROATIAN <a href="http://wbuilder.net/services/codeigniter_croatian_1.7.0.zip">Hrvatski 1.7.0</a> (Sandi Winter &amp; Zoran Vucinic)</p>

<p>- CZECH (UTF8) <a href="http://file.pulc.eu/ci_czech_1.7.1.zip">version 1.7.*</a> (Petr Pulc)</p>

<p>- DANISH <a href="http://derekallard.com/img/post_resources/cilang_danish_1.7.x.zip">1.7.x</a> courtesy of Joakim Kejser.</p>

<p>- DUTCH <a href="http://www.cross-motion.nl/CI/CodeIgniter_v1_7_dutch_language.zip">version 1.7.0</a> (Dennis)</p>

<p>- ESTONIAN <a href="http://www.derekallard.com/img/post_resources/cilang_estonian1_7_0.zip">http://www.derekallard.com/img/post_resources/cilang_estonian1_7_0.zip</a></p>

<p>- FRENCH <a href="http://codeigniter.com/wiki/File:french_1.7.0.zip/" title="File:french_1.7.0.zip" class="noArticle">File:french 1.7.0.zip</a> (Caribou)</p>

<p>- GALICIAN <a href="http://codeigniter.com/wiki/File:CI_lang_1.7.1_galician.zip/" title="File:CI_lang_1.7.1_galician.zip" class="noArticle">File:CI lang 1.7.1 galician.zip</a> (Javier Pico)</p>

<p>- GERMAN <a href="http://codeigniter.com/wiki/File:1.7.0_german_tomcode_felix.zip/" title="File:1.7.0_german_tomcode_felix.zip" class="noArticle">File:1.7.0 german tomcode felix.zip</a> (based on Tomcode, modified by Felix)</p>

<p>- INDONESIAN <a href="http://codeigniter.com/wiki/File:indonesian1_7.zip/" title="File:indonesian1_7.zip" class="noArticle">File:indonesian1 7.zip</a> (dexcell)</p>

<p>- HUNGARIAN <a href="http://codeigniter.com/wiki/File:hungarian-1.7.1.zip/" title="File:hungarian-1.7.1.zip" class="noArticle">File:hungarian-1.7.1.zip</a> (Edmond)</p>

<p>- PERSIAN <a href="http://www.kishmate.com/CodeIgniter/language/1.7.0_persian.zip">http://www.kishmate.com/CodeIgniter/language/1.7.0_persian.zip</a> (Borzoo Mossavari)</p>

<p>- PERSIAN <a href="http://www.kishmate.com/CodeIgniter/language/1.7.1_persian.zip">http://www.kishmate.com/CodeIgniter/language/1.7.1_persian.zip</a> (Borzoo Mossavari)</p>

<p>- POLISH <a href="http://www.sinsoft.pl/files/codeigniter-1.7.0-polish-utf8.zip">http://www.sinsoft.pl/files/codeigniter-1.7.0-polish-utf8.zip</a> (sinsoft)</p>

<p>- PORTUGUESE <a href="http://codeigniter.com/wiki/File:pt-br_1.7.0.zip/" title="File:pt-br_1.7.0.zip" class="noArticle">File:pt-br 1.7.0.zip</a> (Thiago Pojda - Credits to Matheus Bombonato)</p>

<p>- PORTUGUESE <a href="http://codeigniter.com/wiki/File:pt-pt_1.7.0.zip/" title="File:pt-pt_1.7.0.zip" class="noArticle">File:pt-pt 1.7.0.zip</a> (Sofia Peixoto)</p>

<p>- ROMANIAN <a href="http://codeigniter.com/wiki/File:romanian-1.7.1.zip/" title="File:romanian-1.7.1.zip" class="noArticle">File:romanian-1.7.1.zip</a> (Edmond)</p>

<p><img src="http://farm3.static.flickr.com/2268/1756266027_3c8173840f.jpg?v=0"  alt='Russian Flag' /> RUSSIAN <a href="http://codeigniter.com/wiki/File:CI_Russian_1.7.1.zip/" title="File:CI_Russian_1.7.1.zip" class="noArticle">File:CI Russian 1.7.1.zip</a> (DyaGa)</p>

<p><img src="http://farm3.static.flickr.com/2268/1756266027_3c8173840f.jpg?v=0"  alt='Russian Flag' /> RUSSIAN <a href="http://codeigniter.com/wiki/File:CI_Russian_1.7.0.zip/" title="File:CI_Russian_1.7.0.zip" class="noArticle">File:CI Russian 1.7.0.zip</a> (DyaGa)</p>

<p><img src="http://farm3.static.flickr.com/2268/1756266027_3c8173840f.jpg?v=0"  alt='v' /> RUSSIAN <a href="http://rmcreative.ru/files/translations/ci_russian_170.zip">http://rmcreative.ru/files/translations/ci_russian_170.zip</a> (Alexei Shulga / Alexander &#8216;Sam Dark&#8217; Makarov)</p>

<p>- SLOVAK <a href="http://store.starktomas.sk/public/ci_slovak_1.7.1.zip">http://store.starktomas.sk/public/ci_slovak_1.7.1.zip</a> (Tomáš Štark)</p>

<p>- SPANISH <a href="http://codeigniter.com/wiki/File:spanish_1.7.1.zip/" title="File:spanish_1.7.1.zip" class="noArticle">File:spanish 1.7.1.zip</a> (Miguel Herrero, Ivan Argulo)</p>

<p>- SWEDISH <a href="http://codeigniter.com/wiki/File:swedish_1.7.x_utf8.zip/" title="File:swedish_1.7.x_utf8.zip" class="noArticle">File:swedish 1.7.x utf8.zip</a> (Fredrik Johansson)</p>

<p>- TURKISH <a href="http://codeigniter.com/wiki/File:turkish_170_utf-8.zip/" title="File:turkish_170_utf-8.zip" class="noArticle">File:turkish 170 utf-8.zip</a> (Fatih BAZMAN / fatigue (1.7.0)), (Note: UTF8 Encoded)</p>

<h4>[1.6.0 - 1.6.3]</h4><p>
- BRAZILIAN / PORTUGUESE  (UTF-8)<a href="http://www.iboletim.com.br/download/ci-pt-br-utf-8.zip">Português Brasil</a> (translation: Matheus Bombonato, utf-8 encoding: Marcelo Oliveira)</p>

<p>- BRAZILIAN / PORTUGUESE <a href="http://rapidshare.com/files/100611516/ci_pt-br_1.6.1.zip.html">Português Brasil</a> (Matheus Bombonato)</p>

<p>- CROATIAN <a href="http://php.com.hr/download/codeigniter_croatian.zip">Hrvatski 1.6.2</a> (Zoran Vucinic)</p>

<p>- CZECH (UTF8) <a href="http://file.pulc.eu/ci_czech_1.6.3.zip">version 1.6.3</a> (Petr Pulc)</p>

<p>- DUTCH <a href="http://www.bijsterz.nl/ci_lang_pack/dutch.zip">version 1.6.3</a> (Bijsterz)</p>

<p>- GALICIAN <a href="http://www.derekallard.com/img/post_resources/cilang_galician1_6_1.zip">http://www.derekallard.com/img/post_resources/cilang_galician1_6_1.zip</a></p>

<p>- FRENCH <a href="http://metalking.net/CI_1.6.3_french_metalking.zip">CI_1.6.3_french_metalking.zip</a> (metalking - html accents)</p>

<p>- FRENCH <a href="http://tomcode.com/inside/codeigniter/zips/1.6.3_french_tomcode.zip">1.6.3_french_tomcode.zip</a> (tomcode)</p>

<p>- FRENCH <a href="http://tomcode.com/inside/codeigniter/zips/1.6.2_french_tomcode.zip">1.6.2_french_tomcode.zip</a> (tomcode)</p>

<p>- FRENCH <a href="http://tomcode.com/inside/codeigniter/zips/1.6.1_french_tomcode.zip">1.6.1_french_tomcode.zip</a> (tomcode)</p>

<p>- GERMAN <a href="http://tomcode.com/inside/codeigniter/zips/1.6.3_german_tomcode.zip">1.6.3_german_tomcode.zip</a> (tomcode)</p>

<p>- GERMAN <a href="http://tomcode.com/inside/codeigniter/zips/1.6.2_german_tomcode.zip">1.6.2_german_tomcode.zip</a> (tomcode)</p>

<p>- GERMAN <a href="http://tomcode.com/inside/codeigniter/zips/1.6.1_german_tomcode.zip">1.6.1_german_tomcode.zip</a> (tomcode)</p>

<p>- HUNGARIAN <a href="http://codeigniter.com/wiki/File:hungarian163.zip/" title="File:hungarian163.zip" class="noArticle">File:hungarian163.zip</a> (Thoer), (1.6.3)</p>

<p>- ITALIAN <a href="http://www.rollcage.it/external/codeigniter/italian_1.6.zip">http://www.rollcage.it/external/codeigniter/italian_1.6.zip</a> (gyo)</p>

<p>- PERSIAN <a href="http://www.kishmate.com/CodeIgniter/language/1.6.3_persian.zip">http://www.kishmate.com/CodeIgniter/language/1.6.3_persian.zip</a> (Borzoo Mossavari)</p>

<p>- PERSIAN <a href="http://www.kishmate.com/CodeIgniter/language/1.6.2_persian.zip">http://www.kishmate.com/CodeIgniter/language/1.6.2_persian.zip</a> (Borzoo Mossavari)</p>

<p>- POLISH <a href="http://www.polak.ro/uploads/codeigniter/codeigniter-1.6.3-polish.zip">http://www.polak.ro/uploads/codeigniter/codeigniter-1.6.3-polish.zip</a> (riklaunim, groadin, Piotr Polak)</p>

<p>- PORTUGUESE <a href="http://codeigniter.com/wiki/File:pt-pt.zip/" title="File:pt-pt.zip" class="noArticle">version 1.6.x</a> (Rui Peixoto)</p>

<p>- ROMANIAN <a href="http://codeigniter.com/wiki/File:romanian163.zip/" title="File:romanian163.zip" class="noArticle">File:romanian163.zip</a> (Edmond)</p>

<p><img src="http://farm3.static.flickr.com/2268/1756266027_3c8173840f.jpg?v=0"  alt='Russian Flag' /> RUSSIAN <a href="http://rmcreative.ru/files/translations/ci_russian_163.zip">http://rmcreative.ru/files/translations/ci_russian_163.zip</a> (Alexei Shulga / Alexander &#8216;Sam Dark&#8217; Makarov)</p>

<p>- SPANISH <a href="http://www.4shared.com/file/57477180/a1c0f41f/163_spanish.html"> Version 1.6.3</a> (Miguel Herrero)</p>

<p>- SPANISH <a href="http://www.derekallard.com/img/post_resources/cilang_spanish_1_6_1.zip">http://www.derekallard.com/img/post_resources/cilang_spanish_1_6_1.zip</a> (ReynierPM, fdog)</p>

<p>- SWEDISH <a href="http://www.derekallard.com/blog/post/swedish-language-pack-for-codeigniter-16/">http://www.derekallard.com/blog/post/swedish-language-pack-for-codeigniter-16/</a> (Mikael Johansson)</p>

<p>- TURKISH <a href="http://codeigniter.com/wiki/File:turkish_163_utf8.zip/" title="File:turkish_163_utf8.zip" class="noArticle">File:turkish 163 utf8.zip</a> (Fatih BAZMAN / fatigue (1.6.3)), (Note: UTF8 Encoded)</p>

<p>
</p><h4>[1.5.1 - 1.5.4]</h4><p>
- BULGARIAN <a href="http://www.derekallard.com/img/post_resources/cilang_bulgarian.zip">http://www.derekallard.com/img/post_resources/cilang_bulgarian.zip</a></p>

<p>- CHINESE <a href="http://www.esnips.com/doc/20161941-c4b4-4460-bd8e-a5fed8a623ef/chinese-1.5.4.rar">chinese for 1.5.4</a>(by speedu)</p>

<p>- DANISH <a href="http://www.filepanda.com/get/yldxxzk0/">Danish language pack (1.5.4)</a> (daath, Zacharias)<br />
<a href="http://mirror.ordo.dk/codeigniter.com/danish_1.5.x.zip">http://mirror.ordo.dk/codeigniter.com/danish_1.5.x.zip</a> (daath, Zacharias)</p>

<p>- DUTCH <a href="http://www.nmwebservices.nl/blog/2007/01/07/dutch-translation-of-code-igniter/">Updated Dutch translations</a><br />
WARNING! The php-files all end with an empty code after the &#8216;?&gt;&#8217; They could give a &#8216;header already sent&#8217; error.</p>

<p>- FRENCH <a href="http://codeigniter.nouvelle-aire.net/">http://codeigniter.nouvelle-aire.net/</a> (mEga)<br />
<a href="http://metalking.net/ci_v1.5_lang_french.zip">french translation (all new - accents fixed)</a> (metalking.net)<br />
<a href="http://tomcode.com/inside/codeigniter/zips/ci_v1.5_lang_french_corr.zip">ci_v1.5_lang_french_corr.zip</a> (tomcode), (Note: fixed one left accent in db_lang.php of metalking&#8217;s version)</p>

<p>- GALICIAN <a href="http://www.derekallard.com/img/post_resources/cilang_galician1_5_3.zip">http://www.derekallard.com/img/post_resources/cilang_galician1_5_3.zip</a></p>

<p>- GERMAN <a href="http://codeigniter.com/wiki/File:ci_GermanTranslations_1.5.4.zip/" title="File:ci_GermanTranslations_1.5.4.zip" class="noArticle">File:ci GermanTranslations 1.5.4.zip</a> (UnrealMinds), (Note: umlauts as html entities)<br />
<a href="http://codeigniter.com/wiki/File:codeigniter_language_german.zip/" title="File:codeigniter_language_german.zip" class="noArticle">File:codeigniter language german.zip</a> (ArtemisX), (Note: umlauts as html entities)<br />
<a href="http://www.berndmatzner.de/codeigniter/ci_lang_german_1.5.1.zip">http://www.berndmatzner.de/codeigniter/ci_lang_german_1.5.1.zip</a> (bmatzner), (Note: including Sentry language file)</p>

<p>- ITALIAN <a href="http://www.rollcage.it/external/codeigniter/italian_1.5.zip">http://www.rollcage.it/external/codeigniter/italian_1.5.zip</a> (gyo)</p>

<p>- JAPANESE <a href="http://www.cilab.info/data/japanese_translations1.5.zip">http://www.cilab.info/data/japanese_translations1.5.zip</a><br />
Japanese version user guide is also available at: <a href="http://userguide.cilab.info/">http://userguide.cilab.info/</a></p>

<p>- ROMANIAN <a href="http://www.derekallard.com/img/post_resources/cilang_romanian.zip">http://www.derekallard.com/img/post_resources/cilang_romanian.zip</a> (Marius Visan)</p>

<p>- SPANISH <a href="http://www.derekallard.com/img/post_resources/cilang_spanish_1.5.x.zip">http://www.derekallard.com/img/post_resources/cilang_spanish_1.5.x.zip</a> (ReynierPM)<br />
<a href="http://www.tractores.co.cr/spanish_1.6.x.zip">http://www.tractores.co.cr/spanish_1.6.x.zip</a></p>

<p>- TURKISH <a href="http://codeigniter.com/wiki/File:turkish_153_utf8.zip/" title="File:turkish_153_utf8.zip" class="noArticle">File:turkish 153 utf8.zip</a> (M.Musa Ülker - musaulker), (Note: UTF8 Encoded)<br />
<a href="http://codeigniter.com/wiki/File:turkish_153_windows1254.zip/" title="File:turkish_153_windows1254.zip" class="noArticle">File:turkish 153 windows1254.zip</a> (M.Musa Ülker - musaulker), (Note: Windows-1254 Encoded)
</p><h4>[1.4.1]</h4><p>
- FRENCH <a href="http://codeigniter.nouvelle-aire.net/">http://codeigniter.nouvelle-aire.net/</a> (mEga)</p>

<p>- SPANISH <a href="http://www.derekallard.com/img/post_resources/cilang_spanish_1.4.x.zip">http://www.derekallard.com/img/post_resources/cilang_spanish_1.4.x.zip</a> (ReynierPM)</p>

<h4>[1.3.3]</h4><p>
- CHINESE <a href="http://my.opera.com/yarco/homes/blog/chinese.tar.gz">http://my.opera.com/yarco/homes/blog/chinese.tar.gz</a> (by yarco)</p>

<p>- GERMAN <a href="http://tomcode.com/inside/codeigniter/zips/ci_german_translations_1.3.3_v1.zip">http://tomcode.com/inside/codeigniter/zips/ci_german_translations_1.3.3_v1.zip</a> (tomcode)</p>

<p>- POLISH <a href="http://prdownloads.sourceforge.net/rkcmf/polish_code_igniter.zip?download">http://prdownloads.sourceforge.net/rkcmf/polish_code_igniter.zip?download</a> (riklaunim, groadin)</p>

<p>- SPANISH <a href="http://www.semjanelas.net/codeigniter/ci_spanish_1.3.3.zip">http://www.semjanelas.net/codeigniter/ci_spanish_1.3.3.zip</a> (ReynierPM)</p>

<h4>[1.3]</h4><p>
- ITALIAN <a href="http://www.rollcage.it/external/codeigniter/italian_1.3.zip">http://www.rollcage.it/external/codeigniter/italian_1.3.zip</a> (gyo)
</p>
      ]]></content>
    </entry>

    <entry>
      <title>French</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/French/" />
      <id>tag:codeigniter.com,2010:wiki:French/1407.11154</id>
      <published>2010-03-05T17:10:57Z</published>
      <updated>2010-03-05T17:10:57Z</updated>
      <author>
            <name>lolpapa</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <p><b>CodeIgniter language packs</b>
</p><blockquote><p>
Version 1.7.2 same as Version 1.7.1<br />
<a href="http://tomcode.com/inside/codeigniter/zips/1.7.1_french_tomcode.zip">Version 1.7.1</a> translated by tomcode<br />
<a href="http://tomcode.com/inside/codeigniter/zips/1.7.0_french_tomcode.zip">Version 1.7.0</a> translated by tomcode<br />
<a href="http://metalking.net/CI_1.6.3_french_metalking.zip">Version 1.6.3</a> translated by metalking (Note: html accents)<br />
<a href="http://tomcode.com/inside/codeigniter/zips/1.6.3_french_tomcode.zip">Version 1.6.3</a> translated by tomcode<br />
<a href="http://tomcode.com/inside/codeigniter/zips/1.6.2_french_tomcode.zip">Version 1.6.2</a> translated by tomcode<br />
<a href="http://tomcode.com/inside/codeigniter/zips/1.6.1_french_tomcode.zip">Version 1.6.1</a> translated by tomcode<br />
<a href="http://codeigniter.nouvelle-aire.net/">Version 1.5.x</a> translated by mEga<br />
<a href="http://metalking.net/ci_v1.5_lang_french.zip">Version 1.5.x</a> translated by metalking.net (Note: all new - accents fixed)<br />
<a href="http://tomcode.com/inside/codeigniter/zips/ci_v1.5_lang_french_corr.zip">Version 1.5.x</a> translated by tomcode (Note: fixed one left accent in db_lang.php of metalking&#8217;s version)<br />
<a href="http://codeigniter.nouvelle-aire.net/">Version 1.4.1</a> translated by mEga
</p></blockquote>

<p><b>User Guide translations</b>
</p><blockquote><p>
<a href="http://www.codeigniter.fr/">French community &amp; translation (in progress)</a>
</p></blockquote>

<p><a href="http://codeigniter.com/wiki/Category:Contributions::Languages/" title="Category:Contributions::Languages">Category:Contributions -&gt; Languages</a>
</p>
      ]]></content>
    </entry>

    <entry>
      <title>Modular Separation</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/Modular_Separation/" />
      <id>tag:codeigniter.com,2010:wiki:Modular Separation/529.11152</id>
      <published>2010-03-05T09:52:14Z</published>
      <updated>2010-03-05T09:52:14Z</updated>
      <author>
            <name>Phil Sturgeon</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <p>Modular Separation allows you to use modules for code organization in your application while only using a single controller per request. (no HMVC)</p>

<p>It works the same way as Zach’s Matchbox, But is much faster in execution and does the job without using additional module_xxxx() calls.</p>

<p>Modules now comply with CI 1.7.2 also, Controllers in sub-directories are supported and resources may be cross loaded from other modules.</p>

<p>You should be able to take any CodeIgniter application and place it into a module and it should work without alteration. However routes might need altering to allow for the added separation of a module.</p>

<p><a href="http://codeigniter.com/?ACT=51&amp;fid=58&amp;aid=10003_6avIWaB8yxJCM37u2pnH&amp;board_id=2">Download v1.11</a></p>

<p><a href="http://codeigniter.com/forums/viewthread/121820">Forum thread</a></p>

<p>wiredesignz
</p>
      ]]></content>
    </entry>

    <entry>
      <title>Postmark</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/wiki/Postmark/" />
      <id>tag:codeigniter.com,2010:wiki:Postmark/2103.11149</id>
      <published>2010-03-05T02:48:50Z</published>
      <updated>2010-03-05T02:48:50Z</updated>
      <author>
            <name>kristymartin</name>
            <email></email>
      </author>
      <content type="html"><![CDATA[
        <p><span style="font-size:14px;"><b>What is this?</b></span></p>

<p>You&#8217;re looking at the wiki page dedicated to the Postmark library for CodeIgniter.</p>

<p><span style="font-size:14px;"><b>What&#8217;s Postmark?</b></span></p>

<p>Postmark is a transactional e-mail delivery service from Wildbit. Transactional e-mails are the e-mails generated by a web application after an user action such as registration, requesting a password reminder, receiving a reply to a comment, etc. The problem me and many developers faced is that sometimes the client&#8217;s servers are blacklisted and these e-mails land in the users&#8217; spam folder. This is where Postmark comes to the rescue, hopefully – instead of using the built in mail function of your <a href="http://www.seop.com/web-development/">web development</a> language of choice you issue a call to Postmark which sends out the e-mail from their “well regarded” servers so that hopefully they land in the user’s inbox.</p>

<p><span style="font-size:14px;"><b>Download</b></span></p>

<p>For more information and download visit the library&#8217;s <a href="http://www.rusiczki.net/2010/01/25/postmark-library-for-codeigniter/">page</a>.
</p>
      ]]></content>
    </entry>


</feed>