<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ReloadedPC Ashland, Ohio &#187; Code Igniter</title>
	<atom:link href="http://www.reloadedpc.com/category/code-igniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reloadedpc.com</link>
	<description>Small Business Website Development</description>
	<lastBuildDate>Wed, 01 Sep 2010 02:53:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>CodeIgniter + Whitepages.com API Library</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-whitepagescom-api-library/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-whitepagescom-api-library/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 13:51:22 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php library]]></category>
		<category><![CDATA[whitepages.com]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=223</guid>
		<description><![CDATA[I was recently working on another Codeigniter project that I needed to grab some phone, address, &#38; map information for plotting on a map. After doing a little searching I found Whitepages.com has provided an API interface for retrieving data via REST. The methods seemed simple enough, and provided an easy way to create a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codeigniter.com"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="CodeIgniter + Whitepages.com API Library ci logo flame " width="150" height="164" /></a>I was recently working on another Codeigniter project that I needed to grab some phone, address, &amp; map information for plotting on a map. After doing a little searching I found Whitepages.com has provided an API interface for retrieving data via REST. The methods seemed simple enough, and provided an easy way to create a CodeIgniter library to due the dirty work.<span id="more-223"></span>The library is pretty straightforward and includes good easy to read documentation.  You can receive data in either XML or in JSON format. I&#8217;ve included for demo purposes a SimpleXML codeigniter library to parse and convert the XML to an associative array. You can view the controller to see how this was implemented.</p>
<p>As shown in the readme docs, the class is easy to use. Example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$info</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'lastname'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Smith'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'firstname'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'John'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xml'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">whitepages_lib</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">find_person</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This will search using the <strong>find_person</strong> method of the API for the name &#8220;John Smith&#8221;. You can pass any of the fields shown in the documentation in your associative array.</p>
<p>Download <a href='http://www.reloadedpc.com/wp-content/uploads/2010/04/whitepages.zip'>CodeIgniter Whitepages.com API Library</a></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8DNGYPD3WRZCQ">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="CodeIgniter + Whitepages.com API Library pixel " border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" title="CodeIgniter + Whitepages.com API Library" /><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-whitepagescom-api-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeigniter + Geshi</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-geshi/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-geshi/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 14:23:49 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[geshi]]></category>
		<category><![CDATA[php class]]></category>
		<category><![CDATA[php library]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=217</guid>
		<description><![CDATA[Geshi is a PHP class to do the heavy lifting for syntax highlighting output to your browswer. Geshi started originally to help users highlight code posted on bulletin board sites. I converted the standard Geshi class into a Codeigniter library. Just a simple as renaming the class and created a few methods to conform to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://qbnz.com/highlighter/">Geshi</a> is a PHP class to do the heavy lifting for syntax highlighting output to your browswer. <a href="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="Codeigniter + Geshi ci logo flame " width="150" height="164" /></a>Geshi started originally to help users highlight code posted on bulletin board sites. I converted the standard Geshi class into a Codeigniter library. Just a simple as renaming the class and created a few methods to conform to some of the options you&#8217;ll find in codeigniter.<br />
<span id="more-217"></span><br />
Download <a href="http://www.reloadedpc.com/wp-content/uploads/2010/04/geshi-CI-library.zip">Codeigniter Geshi Library</a></p>
<p>Here&#8217;s how you will use this library in Codeigniter. First, extract the zip file and place the contents into your /application/libraries folder within your codeigniter folder structure.</p>
<p>Example code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'geshi'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//load geshi class</span>
&nbsp;
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'set_language'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'php'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//REQUIRED set language to parse</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'set_source'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'foreach($test as $item){ echo &quot;hello&quot;;}'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//REQUIRED set source code to parse</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">initialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">output</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//output from geshi alias of parse_code</span></pre></div></div>

<p>You can pass any geshi method or variable in the config array. Just name the key the same as the method or variable you are setting, and the value to what you would like to pass.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8DNGYPD3WRZCQ">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="Codeigniter + Geshi pixel " border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" title="Codeigniter + Geshi" /><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-geshi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Uploadify 2 + CodeIgniter</title>
		<link>http://www.reloadedpc.com/code-igniter/jquery-uploadify-2-codeigniter/</link>
		<comments>http://www.reloadedpc.com/code-igniter/jquery-uploadify-2-codeigniter/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 20:43:53 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[uploadify]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=123</guid>
		<description><![CDATA[Creating useful upload forms having become very popular on the web these days. Many people have found that flash based options create a more rich user experience. I was working on a project recently to allow a user to upload images to a CodeIgniter application. I enjoy using jQuery, and found an excellent flash based [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.uploadify.com"><img class="alignright size-medium wp-image-124" title="uploadify-logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/10/uploadify-logo-300x48.jpg" alt="jQuery Uploadify 2 + CodeIgniter uploadify logo 300x48 " width="300" height="48" /></a>Creating useful upload forms having become very popular on the web these days. Many people have found that flash based options create a more rich user experience. I was working on a project recently to allow a user to upload images to a <a href="http://www.codeigniter.com">CodeIgniter</a> application. I enjoy using jQuery, and found an excellent flash based uploader in <a href="http://www.uploadify.com/">Uploadify</a>. <span id="more-123"></span>The most recent version added many new features over the previous version.  However, there seems to be a need for a quick tutorial for integrating Uploadify into CodeIgniter.  Here is a zip file that you can drop into your CodeIgniter application to see how it works.</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2009/10/codeigniter-uploadify.zip">Download CodeIgniter Uploadify Demo</a> (updated 11/25/2009)</p>
<p>The demo zip file contains the uploadify source files as well the controllers and views to get this to work. Just unzip the folder and drop into your CodeIgniter folder. The structure is:</p>
<blockquote>
<ul>
<li>/js/uploadify/ (uploadify files)</li>
<li>/system/application/controllers/upload.php</li>
<li>/system/application/views/upload/ (2 view files)</li>
<li>/uploads (blank folder where files are uploaded to)</li>
</ul>
</blockquote>
<p>The code is very simple and I have used it several different ways after getting this to work.  You will need to also add a standard upload form to the controller as well for users with Flash disabled. That&#8217;s part is pretty straight forward and is provide in the <a href="http://codeigniter.com/user_guide/libraries/file_uploading.html">CodeIgniter user guide</a>.  When I was first trying to integrate the two, I was trying too hard to find a solution using CI&#8217;s built in upload functions. I was reading in the documentation and found the onComplete callback.  I modified some of the code in the upload.php included in the uploadify source download. The file now echoes a JSON string back when the upload completes. The JSON string is then posted back to CodeIgniter using jQuery.</p>
<p>In /js/uploadify/uploadify.php where the upload is handled by the flash uploader, you will find the code creating the JSON string. You may add more values to the array where you would need them.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$filearray</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$newf_name</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'real_name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$real_name</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_ext'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$file_ext</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_size'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$file_size</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_path'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$targetFile</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_temp'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$file_temp</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000088;">$json_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filearray</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$json_array</span><span style="color: #339933;">;</span></pre></div></div>

<p>Here is where the JSON string is handled in CodeIgniter</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//system/application/controllers/upload.php</span>
<span style="color: #000000; font-weight: bold;">function</span> uploadify<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//Decode JSON returned by /js/uploadify/upload.php</span>
		<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>input<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>post<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'filearray'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'json'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>load<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>view<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload/uploadify'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>An additional note pointed out in the CI forums is to be sure to add in your /application/config/mimes.php file for each file type you will be uploading:</p>
<p><code><br />
'application/octet-stream'<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/jquery-uploadify-2-codeigniter/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Shopping Cart Library</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-shopping-cart-library/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-shopping-cart-library/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 18:22:20 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[shopping cart]]></category>
		<category><![CDATA[wfcart]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=44</guid>
		<description><![CDATA[CodeIgniter is a great PHP framework to work with. One of the items several developers have been asking to be included in the next CodeIgniter release, is a core library for a shopping cart. The library is being added for CI version 1.7.2, and is currently available via SVN on the CodeIgniter website. UPDATE 09/12/2009: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codeigniter.com">CodeIgniter</a> is a great PHP framework to work with. One of the items several <a rel="attachment wp-att-41" href="http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/attachment/ci_logo_flame/"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="CodeIgniter Logo" width="150" height="164" /></a>developers have been asking to be included in the next CodeIgniter release, is a core library for a shopping cart. <span style="text-decoration: line-through;">The library is being added for CI version 1.7.2, and is currently available via <a href="http://dev.ellislab.com/svn/CodeIgniter/trunk">SVN on the CodeIgniter</a> website.</span></p>
<p><strong>UPDATE 09/12/2009: </strong>The shopping cart library has now been released as part of the Code Igniter stable release version 1.7.2. You can dowload it at  <a href="http://codeigniter.com/downloads/">CodeIgniter.com</a></p>
<p><span id="more-44"></span></p>
<p>I have used <a href="http://www.webforcecart.com/">wfCart</a> class in another CI project I worked on. It provides simple functionality: add, edit, delete products along with displaying the shopping cart contents. wfCart took a little hacking of the code and adding the CI object to the code in order to use some the builtin features of CI. It worked well, but lacked the naming conventions that make CI so great.</p>
<p>I decided to give the Cart library a try, so I put together some simple code to see the functionality of the Cart class. Posted below is download of files you can drop into your CodeIgniter application, and try it out for yourself.</p>
<p>I created a new controller and named it Cart.php.</p>
<p>The code in the controller offers simple functionality:</p>
<ul>
<li>View products</li>
<li>View shopping cart</li>
<li>Update shopping cart quantities</li>
<li>Delete products from shopping cart</li>
</ul>
<p>You will need a table to your database to store the product information.</p>
<p>[code]<br />
CREATE TABLE IF NOT EXISTS `product` (<br />
`product_id` int(10) NOT NULL AUTO_INCREMENT,<br />
`product_sku` varchar(100) NOT NULL,<br />
`product_description` varchar(200) NOT NULL,<br />
`product_family` varchar(250) NOT NULL,<br />
`product_quantity` double(10,4) NOT NULL,<br />
`product_price` double(10,2) NOT NULL,<br />
`vendor_id` int(10) NOT NULL,<br />
`user_id` int(10) NOT NULL,<br />
PRIMARY KEY (`product_id`),<br />
UNIQUE KEY `product_id` (`product_id`)<br />
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;[/code]</p>
<p>Just add a couple products to the table, and you should be able to test this out.</p>
<p><a rel="attachment wp-att-59" href="http://www.reloadedpc.com/code-igniter/codeigniter-shopping-cart-library/attachment/cart/">Download Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-shopping-cart-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Flash Chart 2 + CodeIgniter</title>
		<link>http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/</link>
		<comments>http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 15:00:03 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[ofc]]></category>
		<category><![CDATA[open flash chart]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=23</guid>
		<description><![CDATA[Many of you maybe familiar with the CodeIgniter (CI) PHP framework. I was asked by a client recently about creating a graph for some data in a report. Looking through several charting libraries at the CI website, I found a few options listed in the wiki. Open Flash Chart 2 (OFC) seemed like a nice [...]]]></description>
			<content:encoded><![CDATA[<p>Many of you maybe familiar with the <a href="http://www.codeigniter.com">CodeIgniter</a> (CI) PHP framework. I was asked by a client recently about creating a graph for some data in a report. <a rel="attachment wp-att-41" href="http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/attachment/ci_logo_flame/"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="CodeIgniter Logo" width="150" height="164" /></a>Looking through several charting libraries at the CI website, I found a few options listed in the wiki. <a href="http://teethgrinder.co.uk/open-flash-chart-2/">Open Flash Chart 2</a> (OFC) seemed like a nice option and was also open source. There was a couple libraries written for CI using Open Flash Chart, but the recent code for OFC has recently changed.<span id="more-23"></span></p>
<p>The new code for Open Flash Chart 2 has separated the PHP classes making it very difficult using in CodeIgniter. Thankfully <a href="http://codeigniter.com/forums/member/97515/">Mesozoic</a> had merged all of the classes back into a single file.</p>
<p>Here are the steps getting CodeIgniter and Open Flash Chart 2 to play nicely together. Download the <a href="http://www.reloadedpc.com/wp-content/uploads/2009/07/ofc.zip">Open Flash Chart 2</a> and extract the files. In this zip file you will need to extract open-flash-chart.swf to the root folder of your server. Then place the other files in the application folder into your CI application folder.</p>
<p>I&#8217;ve also coded  a CI helper for inserting the chart into your page that plays nicely with CI&#8217;s URL helper.  Here&#8217;s example of how to use Open Flash Chart 2:</p>
<p>In the controller of your application add the following code below.</p>
<p>[php]</p>
<p>$this-&amp;gt;load-&amp;gt;helper(&#8216;open-flash-chart&#8217;); // load helper function<br />
$this-&amp;gt;load-&amp;gt;library(&#8216;ofc&#8217;); //load Open Flash Chart<br />
[/php]</p>
<p>Now you can use the code that is shown on the Open Flash Chart website, execpt make a like change when building the chart. You will now use:</p>
<p>[php]</p>
<p>$this-&amp;gt;ofc-&amp;gt;open_flash_chart();<br />
$this-&amp;gt;ofc-&amp;gt;set_title( $title );<br />
$this-&amp;gt;ofc-&amp;gt;add_element( $line );<br />
$this-&amp;gt;ofc-&amp;gt;set_x_axis( $x_axis );<br />
$this-&amp;gt;ofc-&amp;gt;set_y_axis( $y_axis);<br />
return $this-&amp;gt;ofc-&amp;gt;toPrettyString();</p>
<p>[/php]</p>
<p>You can find more information on this on the <a href="http://codeigniter.com/forums/viewreply/605019/">CodeIgniter forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 4/12 queries in 0.005 seconds using disk

Served from: www.reloadedpc.com @ 2010-09-09 08:05:07 -->