<?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"
	>

<channel>
	<title>the web developer's journal &#187; CodeIgniter</title>
	<atom:link href="http://bizwidgets.biz/blog/posts/category/codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://bizwidgets.biz</link>
	<description>building a web solutions company...</description>
	<pubDate>Tue, 10 Jun 2008 02:59:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>A *NEW* Open Source Content Management System built in Codeigniter</title>
		<link>http://bizwidgets.biz/blog/posts/open-source-codeigniter-content-management-system/</link>
		<comments>http://bizwidgets.biz/blog/posts/open-source-codeigniter-content-management-system/#comments</comments>
		<pubDate>Sun, 11 Nov 2007 18:06:28 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Web2.0]]></category>

		<guid isPermaLink="false">http://bizwidgets.biz/blog/posts/open-source-codeigniter-content-management-system/</guid>
		<description><![CDATA[You may find we don&#8217;t write on our blog every day like a lot of other companies. We try to focus on publishing quality posts about a certain area of the market that we feel strongly about. Although we probably should be posting more frequently, most of our time is spent developing web solutions that [...]]]></description>
			<content:encoded><![CDATA[<p>You may find we don&#8217;t write on our blog every day like a lot of other companies. We try to focus on publishing quality posts about a certain area of the market that we feel strongly about. Although we probably should be posting more frequently, most of our time is spent developing web solutions that will be eventually released as open source or as a commercial solution for you and your company.<span id="more-66"></span></p>
<p>This post is a teaser of what we are releasing in the next few weeks. We haven&#8217;t given it a name yet, but it will be an open source web publishing and content management system built in PHP, specifically CodeIgniter. We are integrating the best features from the popular content management systems and blogging platforms like Wordpress, Tumblr, Expression Engine, etc. and building a CodeIgniter library that <strong>you </strong>can edit easily and use for your own websites. Since it is open source, we will always accept your suggestions and implement them in new releases. It&#8217;s going to be simple, functional, and it <strong>won&#8217;t be packing any extra weight.</strong> We like how CodeIgniter is structured and we build our applications the same way: the basics are always there, but if you need customization, there is always room to flex.</p>
<p><strong>Plus,</strong> if you remember our user management system that we released a while ago called <a title="ezauth - access control list and user management system built in codeigniter" href="http://bizwidgets.biz/solutions/ezauth/">EzAuth</a>, this new content management system will integrate <strong>perfectly </strong>and <strong>seamlessly.</strong> We appreciate all the great feedback on <a title="ezauth" href="http://bizwidgets.biz/solutions/ezauth">EzAuth</a> and we take a great amount of pride in the interlocking web solutions we are developing for small businesses.</p>
<p>Thanks everyone. If you want to be informed when we release our new CMS system, please send an e-mail to <a title="be informed when we release our CMS solution!" href="mailto:cms@bizwidgets.biz">cms@bizwidgets.biz</a> and we will send you download information when it comes out. Again, thanks for the support everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://bizwidgets.biz/blog/posts/open-source-codeigniter-content-management-system/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mac OS X Leopard: Web Sharing Troubles: &#8220;Forbidden&#8221;</title>
		<link>http://bizwidgets.biz/blog/posts/mac-os-x-leopard-web-sharing-troubles-forbidden/</link>
		<comments>http://bizwidgets.biz/blog/posts/mac-os-x-leopard-web-sharing-troubles-forbidden/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 21:24:01 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
		<category><![CDATA[Apple]]></category>

		<category><![CDATA[CodeIgniter]]></category>

		<guid isPermaLink="false">http://bizwidgets.biz/blog/posts/mac-os-x-leopard-web-sharing-troubles-forbidden/</guid>
		<description><![CDATA[If you&#8217;ve installed Mac OS X Leopard 10.5 already and you use the built in apache server &#8220;Web Sharing&#8221; you will need to follow these steps before your web server works again. If you&#8217;ve tried to visit a page on your local server, you will be greeted by this message:
Forbidden (403)
You don't have permission to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve installed Mac OS X Leopard 10.5 already and you use the built in apache server &#8220;Web Sharing&#8221; you will need to follow these steps before your web server works again. If you&#8217;ve tried to visit a page on your local server, you will be greeted by this message:</p>
<h2>Forbidden (403)</h2>
<p><code>You don't have permission to access /~danielerrante/ezslide/ on this server.</code></p>
<p>Leopard fails to copy the settings from apache in Tiger to apache2 in Leopard. Therefore, you will need to follow these <strong>simple</strong> steps to get your server up again.<span id="more-56"></span></p>
<p>If you can vaguely remember creating a configuration file when you first set up Tiger called yourusername.conf, you will need to do that in apache2&#8217;s /etc/apache2/users/ folder and add the following to that file:<br />
<code><br />
&lt;Directory "/Users/danielerrante/Sites/"&gt;<br />
Options Indexes MultiViews<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;</code></p>
<p>Replace danielerrante with your username. <strong>Or, you can do all that by copying and pasting one line in terminal:</strong></p>
<p><code>sudo cp /private/etc/httpd/users/* /private/etc/apache2/users/<br />
</code><br />
Next, you will need to /etc/apache2/httpd.conf and enable PHP5. To do this, navigate to this line:</p>
<p><code>#LoadModule php5_module        libexec/apache2/libphp5.so<br />
</code><br />
Uncomment that line by removing the pound sign.</p>
<p>Last step: Restart your web server by going to the system preferences, uncheck web sharing, then check it again so it restarts.</p>
<p>You&#8217;re done!</p>
<p>Source: <a href="http://discussions.apple.com/thread.jspa?threadID=1187457&amp;tstart=15" title="http://discussions.apple.com/thread.jspa?threadID=1187457&amp;tstart=15">http://discussions.apple.com/thread.jspa?threadID=1187457&amp;tstart=15</a></p>
<blockquote></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://bizwidgets.biz/blog/posts/mac-os-x-leopard-web-sharing-troubles-forbidden/feed/</wfw:commentRss>
		</item>
		<item>
		<title>EzAuth (0.4 beta) Release - Our User Management System</title>
		<link>http://bizwidgets.biz/blog/posts/ezauth-04-beta-release-our-user-management-system/</link>
		<comments>http://bizwidgets.biz/blog/posts/ezauth-04-beta-release-our-user-management-system/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 21:37:09 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

		<category><![CDATA[Web Design]]></category>

		<category><![CDATA[Web2.0]]></category>

		<guid isPermaLink="false">http://bizwidgets.biz/blog/posts/ezauth-04-beta-release-our-user-management-system/</guid>
		<description><![CDATA[We released our open source authorization system today. It helps you manage your users on your website, taking care of the following:
- user registration (with optional e-mail verification)
- user login
- lost account retrieval
- password changing
- user session management
- password protecting certain pages or sections of your website
It is built using the CodeIgniter PHP framework so [...]]]></description>
			<content:encoded><![CDATA[<p>We released our open source authorization system today. It helps you manage your users on your website, taking care of the following:</p>
<p>- user registration (with optional e-mail verification)<br />
- user login<br />
- lost account retrieval<br />
- password changing<br />
- user session management<br />
- password protecting certain pages or sections of your website</p>
<p>It is built using the CodeIgniter PHP framework so you will need that installed until we port it for general use. <a href="http://bizwidgets.biz/solutions/ezauth" title="download ezauth">Check it out</a>, there&#8217;s a <a href="http://bizwidgets.biz/demos/ezauth/mystore" title="try out the online demo of ezauth">fully working online demo</a> and <a href="http://bizwidgets.biz/user_guide/ezauth.htm" title="ezauth user guide">user guide with lots of documentation</a> as well!</p>
]]></content:encoded>
			<wfw:commentRss>http://bizwidgets.biz/blog/posts/ezauth-04-beta-release-our-user-management-system/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ListRankr - Our New Web2.0 Service!</title>
		<link>http://bizwidgets.biz/blog/posts/listrankr-our-new-web20-service/</link>
		<comments>http://bizwidgets.biz/blog/posts/listrankr-our-new-web20-service/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 15:33:42 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

		<category><![CDATA[Web2.0]]></category>

		<guid isPermaLink="false">http://bizwidgets.biz/blog/posts/listrankr-our-new-web20-service/</guid>
		<description><![CDATA[We launched a great new web2.0 service the other day called ListRankr. ListRankr allows you to make lists about anything. For example, if you want to find some great Italian restaurants in your local area, you can go to ListRankr and view the list of local restaurants, in order of people&#8217;s preference. Users can vote [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://apps.facebook.com/listrankr/" title="ListRankr Application on Facebook"><img src="http://listrankr.com/images/facebook_listrankr.png" title="Facebook ListRankr Picture" alt="Facebook ListRankr Picture" style="padding-left: 20px; padding-bottom: 10px" align="right" border="0" height="256" width="344" /></a>We launched a great new web2.0 service the other day called <a href="http://listrankr.com/" title="ListRankr - Everything's a list.">ListRankr</a>. ListRankr allows you to make lists about anything. For example, if you want to find some great Italian restaurants in your local area, you can go to ListRankr and view the list of local restaurants, in order of people&#8217;s preference. Users can vote restaurants up or down, mark their favorite (which counts as an extra vote), and read reviews about every restaurant in the list.</p>
<p>If the list doesn&#8217;t exist, create it! Then invite your friends to review and rank your list.</p>
<p>You can make a list for pretty much everything. Here are some random examples:</p>
<ul>
<li>Cars you are looking to buy</li>
<li>Cooks on the Food Network</li>
<li>Best TV Shows</li>
<li>Bottled Water Brands</li>
<li>National Food Chains</li>
<li>Beers</li>
<li>Best Movies of All Time</li>
</ul>
<p>We think this is a great tool that can be used for pretty much everything. Signup is free, and ListRankr just requires a valid e-mail, username and password. Beware, however, because once you start voting, you can&#8217;t stop! <img src='http://bizwidgets.biz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Our Facebook version is currently in beta testing, look for it soon! If you want to be involved in the beta testing, you can visit the facebook application page at <a href="http://apps.facebook.com/listrankr/" title="Facebook version of ListRankr">apps.facebook.com/listrankr/</a>, or visit the stand-alone site (a tad faster) <a href="http://listrankr.com/" title="ListRankr - Everything's a list.">ListRankr.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bizwidgets.biz/blog/posts/listrankr-our-new-web20-service/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How CodeIgniter Keeps You Organized</title>
		<link>http://bizwidgets.biz/blog/posts/how-codeigniter-keeps-you-organized/</link>
		<comments>http://bizwidgets.biz/blog/posts/how-codeigniter-keeps-you-organized/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 17:05:13 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

		<category><![CDATA[SEO]]></category>

		<category><![CDATA[Web Design]]></category>

		<category><![CDATA[Web2.0]]></category>

		<guid isPermaLink="false">http://bizwidgets.biz/blog/posts/how-codeigniter-keeps-you-organized/</guid>
		<description><![CDATA[I have written a few articles on CodeIgniter now because it truly has changed the way I develop websites. It has cut the development time in at least half, preventing redundant work by providing great built-in features that I can use in every one of my projects. Plus, CodeIgniter is so easy to pick up. [...]]]></description>
			<content:encoded><![CDATA[<p>I have written a few articles on CodeIgniter now because it truly has changed the way I develop websites. It has cut the development time in at least half, preventing redundant work by providing great built-in features that I can use in every one of my projects. Plus, CodeIgniter is so easy to pick up. You can start building CI apps in about 10 minutes after watching the <a href="http://codeigniter.com/tutorials/" title="CodeIgniter Tutorials">CI tutorials</a> and reading <a href="http://bizwidgets.biz/blog/posts/build-your-first-web-20-app-with-php-ajax-and-codeigniter/" title="My Tutorial on CI apps">my tutorial</a> on getting set up. If you are new to Object Oriented Programming, you can <a href="http://bizwidgets.biz/blog/posts/why-php-and-javascript-object-oriented-programming-oop-are-easier/" title="Intro to OOP">read my introduction to OOP</a> also.</p>
<p>The way CodeIgniter keeps you organized is this: It keeps everything separate and in their own folders. Just as you would build a website and have an images, css, and javascripts folder so they are separate from the rest of your website, CodeIgniter takes the extra step and organizes your actual website content.  CodeIgniter organizes your projects for you with MVC (Model-View-Controller) programming. Here&#8217;s the basic structure for MVC projects:</p>
<p>Models</p>
<ul>
<li>Interact with your database and return the retrieved data to the controller.</li>
<li>These are the files you want to build once and not have to edit them ever again. For example, a blog model would include functions to retrieve blog posts and comments, pages, users, page views, etc.</li>
</ul>
<p>Controllers</p>
<ul>
<li>Your controller will load a model, such as a blog model, to retrieve data such as a blog post. You can manipulate the data however you want here and then pass it on to the view.</li>
</ul>
<p>Views</p>
<ul>
<li>Views are what the visitor actually sees. You want this to contain as little PHP and and styling code as possible. This is for your raw content. Use style sheets to style the content and trim the PHP code as much as possible.</li>
</ul>
<p>Images</p>
<ul>
<li>Store your images in an images folder in the website root folder. If you have trouble calling retrieving images with CodeIgniter <a href="http://http://bizwidgets.biz/blog/posts/build-your-first-web-20-app-with-php-ajax-and-codeigniter/" title="CodeIgniter and .htaccess">read my article on how to stop these headaches</a>.</li>
</ul>
<p>Javascripts</p>
<ul>
<li>Try to attach your javascript functions to the DOM after the page loads in your javascript file. This way, you can keep your javascript functions out of the views that are for your content, and it helps you program your website to be compatible with browsers that aren&#8217;t using javascript.</li>
</ul>
<p>CSS</p>
<ul>
<li>Style your page here. Try to stay away from inline styling. This way, search engines and visitors who are using mobile devices will be able to see your page without styling getting in the way.</li>
</ul>
<p>.htaccess file</p>
<ul>
<li>This file, along with your routes.php file in the CodeIgniter config folder, re-routes your URLs to look pretty. This really helps search engines and visitors remember where pages are on your website. You can get rid of URLs with metadata in them. (http://www.thiswebsite.com/index.php?function=how%20to%20get%20rid%20of%20stupid%20long%20URLs)</li>
</ul>
<p>Voila. Organized Website Project.</p>
<p>I will accept donations via paypal @ daniel@distributorone.com. Just Kidding.</p>
<p>Thanks to CodeIgniter, MooTools, and new knowledge of how Object Oriented Programming is supposed to work, my projects are much more organized, and I can spend more time being productive because of these tools. Thanks for reading!</p>
]]></content:encoded>
			<wfw:commentRss>http://bizwidgets.biz/blog/posts/how-codeigniter-keeps-you-organized/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why PHP and Javascript Object Oriented Programming (OOP) are Easier</title>
		<link>http://bizwidgets.biz/blog/posts/why-php-and-javascript-object-oriented-programming-oop-are-easier/</link>
		<comments>http://bizwidgets.biz/blog/posts/why-php-and-javascript-object-oriented-programming-oop-are-easier/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 15:14:17 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://bizwidgets.biz/blog/posts/why-php-and-javascript-object-oriented-programming-oop-are-easier/</guid>
		<description><![CDATA[I use the CodeIgniter and MooTools frameworks for my website projects nowadays. They are far easier to work with and understand if you understand Object Oriented Programming. If you are spaghetti coding your websites line by line, you will be in for a treat when you learn OOP. Here is how it works:
Say you want [...]]]></description>
			<content:encoded><![CDATA[<p>I use the <a href="http://codeigniter.com" title="CodeIgniter">CodeIgniter</a> and <a href="http://mootools.net" title="MooTools">MooTools</a> frameworks for my website projects nowadays. They are far easier to work with and understand if you understand Object Oriented Programming. If you are spaghetti coding your websites line by line, you will be in for a treat when you learn OOP. Here is how it works:</p>
<p>Say you want to describe a human being with code. You will create a class called Human:</p>
<p><code>class Human {</code></p>
<p><code>}</code></p>
<p>Now, you want the human to perform a few functions. This is simple also; you create functions within the class to describe the human&#8217;s actions.</p>
<p><code>class Human {</code></p>
<blockquote><p><code>    function Eat($food) {</code></p>
<p><code>    }</code></p>
<p><code>    function Sleep($time) {</code></p>
<p><code>    }</code></p></blockquote>
<p><code>}</code></p>
<p>Now our human can eat and sleep. In PHP, you would create a new human by instantiation. So we can create Bob.</p>
<p><code>$Bob = new Human();</code></p>
<p>If we want Bob to eat,</p>
<p><code>$Bob-&gt;Eat($chicken);</code></p>
<p>Go to sleep, Bob!</p>
<p><code>$Bob-&gt;Sleep($one_hour);</code></p>
<p>We have just told Bob to eat chicken and sleep for an hour. Pretty easy, eh?</p>
<p>This same principal applies to CodeIgniter for PHP and MooTools for Javascript. They are object oriented, so it is very easy to implement them into youur websites. If you need session handling to password protect certain pages of your website, you just instantiate the session library in CodeIgniter and it will manage user sessions for you. If you need to update a layer on your website dynamically, such filling in the current weather or water temperature (such as this site: <a href="http://www.easylakeliving.com" title="Easy Lake Living">www.easylakeliving.com</a>) you can do so simply by calling:</p>
<p><code>new Ajax('url_to_get_weather', {</code><br />
<code>method: 'get',</code><br />
<code>update: $('current_weather')</code><br />
<code>}).request();</code></p>
<p>Just by calling Ajax, you are updating the &#8216;current_weather&#8217; layer on the website with the information provided by the URL &#8216;url_to_get_weather.&#8217;</p>
<p>That&#8217;s OOP for ya!</p>
]]></content:encoded>
			<wfw:commentRss>http://bizwidgets.biz/blog/posts/why-php-and-javascript-object-oriented-programming-oop-are-easier/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CodeIgniter Routes Trick - Removing Controller Names from the URI to Keep URLs Short.</title>
		<link>http://bizwidgets.biz/blog/posts/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/</link>
		<comments>http://bizwidgets.biz/blog/posts/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 14:38:07 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

		<category><![CDATA[SEO]]></category>

		<category><![CDATA[Web Design]]></category>

		<category><![CDATA[Web2.0]]></category>

		<guid isPermaLink="false">http://bizwidgets.biz/blog/posts/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/</guid>
		<description><![CDATA[CodeIgniter is great because you can separate your content from your styling with controllers, models, and views. Another great thing is when you create a website with CI, you automatically use friendly URLs (if you use an .htaccess file). If you have a bunch of unrelated pages however, you might wonder how you can keep [...]]]></description>
			<content:encoded><![CDATA[<p>CodeIgniter is great because you can separate your content from your styling with controllers, models, and views. Another great thing is when you create a website with CI, you automatically use friendly URLs (<a href="http://bizwidgets.biz/blog/posts/build-your-first-web-20-app-with-php-ajax-and-codeigniter/" title="Building with CodeIgniter">if you use an .htaccess file</a>). If you have a bunch of unrelated pages however, you might wonder how you can keep those URLs as tiny as possible without having thirty different controllers for each page. For example, I have a CI application with a home controller that has about 20 different functions inside of it. To access each one of these functions, I would normally visit http://localhost/home/contact or http://localhost/home/about_us. Since we don&#8217;t really need home in the URL, I have found a way to remove it from the URL, still allowing other controllers to function normally. Here&#8217;s how to do it:</p>
<p>Open up your routes.php file inside the application/config folder in your CI app and add the following line to the end of the routes.php file:</p>
<p><code>$route['^(?!ezstore|ezsell|login).*'] = &#8220;home/$0&#8243;;</code></p>
<p>This line uses a regular expression that means, If a visitor goes to any url EXCEPT ezstore, ezsell, or login, redirect them to the home controller, and the function inside the home controller ($0). This way, every time we call a function from the home controller, such as contact, about_us, services, etc., we can snip home out of the URL and keep our URLs short and pretty.</p>
<p>The end!</p>
]]></content:encoded>
			<wfw:commentRss>http://bizwidgets.biz/blog/posts/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Build your First Web 2.0 App with PHP, Ajax and CodeIgniter</title>
		<link>http://bizwidgets.biz/blog/posts/build-your-first-web-20-app-with-php-ajax-and-codeigniter/</link>
		<comments>http://bizwidgets.biz/blog/posts/build-your-first-web-20-app-with-php-ajax-and-codeigniter/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 03:15:16 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
		
		<category><![CDATA[CodeIgniter]]></category>

		<category><![CDATA[SEO]]></category>

		<category><![CDATA[Web Design]]></category>

		<category><![CDATA[Web2.0]]></category>

		<guid isPermaLink="false">http://bizwidgets.biz/blog/posts/build-your-first-web-20-app-with-php-ajax-and-codeigniter/</guid>
		<description><![CDATA[CodeIgniter is an awesome tool if you want to learn PHP or start to use object oriented programming (OOP) with your new website. CodeIgniter is flexible with a small footprint and offers tons of features already built in, such as session management, active record use with mysql databases. The best part is it lets you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codeigniter.com" title="CodeIgniter Website">CodeIgniter</a> is an awesome tool if you want to learn PHP or start to use object oriented programming (OOP) with your new website. CodeIgniter is flexible with a small footprint and offers tons of features already built in, such as session management, active record use with mysql databases. The best part is it lets you use Model-View-Controller (MVC) programming. This way, your styling (view) is separate from your content (generated by controller) and lets you manipulate your raw data with a model.</p>
<p>There are two awesome video tutorials on CodeIgniter to show you how powerful and easy CodeIgniter can be when starting a website; however the first time I tried setting up an application I had trouble linking to images, css, and javascripts and setting up an htaccess file for friendly URLs. I have included a set of directions to help with these issues in your first CodeIgniter app.</p>
<p>I am working on a mac so if you have one also the tutorial may be a bit easier to follow. This tutorial also assumes you have a running apache web server with PHP and MySQL installed.</p>
<p>You will need a few files to start with your CodeIgniter app. You can download them from their websites below or <a href="http://bizwidgets.biz/uploads/ci_project.zip" title="CodeIgniter Starter Project">download the zip file full</a> I have compiled with everything you need (including CodeIgniter 1.5.4 and full compiled mootools). If you download my zip file with all the necessary components, just drag the files to a new directory in your server folder and you can skip right to developing a controller and view.</p>
<ul>
<li>If you don&#8217;t have CodeIgniter already, download it at <a href="http://www.codeigniter.com" title="CodeIgniter Download">codeigniter.com</a>.</li>
<li>If you want to use ajax, download the javascript file at mootools.net. There are also some really cool <a href="http://demos.mootools.net" title="MooTools Demos">demos of mootools</a> in action. The best part is mootools is object oriented just like CodeIgniter is! It really <em>is</em> a simpler way to program.</li>
<li>If you want to use friendly URLs, such as http://your-host-name/blog or http://your-host-name/contact, you will need an htaccess file, which helps in redirecting browser queries to the right place. Otherwise, your URLs will have index.php stuck in the middle of them (http://your-host-name/index.php/contact).</li>
</ul>
<p>Now that you have CodeIgniter, drag the index.php file and system folder to a new project folder in your hosting root. I named my project folder c3. In this folder, I have created a few folders: images, _js, css, and uploads. Remember the names of these folders because you will need them for your .htaccess file.</p>
<p style="text-align: center"><img src="http://bizwidgets.biz/images/folderview.png" title="CodeIgniter Project View in Mac OS X" alt="CodeIgniter Project View in Mac OS X" height="288" width="500" /></p>
<p> In order to use friendly URLs with CodeIgniter, you need to set up an .htaccess file in your project folder. On my Mac and the web server I use, the file is invisible, but if you open your project folder with <a href="http://www.macromates.com" title="TextMate">textmate</a> you will be able to create the file and access it later.  Inside this is what I have successfully used on my mac for rerouting to work.</p>
<p><code>Options +FollowSymLinks<br />
RewriteEngine on<br />
#RewriteCond $1 !^(index\.php|images|css|_js|uploads|robots\.txt)<br />
#RewriteRule ^(.*)$ /~danielerrante/bizwidgets/index.php/$1 [L]</code></p>
<p>Creating an .htaccess file will solve a lot of headaches later down the road. This enables your website to get photos, javascripts and css files from the appropriate folders while still re-routing page calls.</p>
<p><a href="http://bizwidgets.biz/images/textmate_project.png" target="_blank" title="Textmate Project"></a></p>
<p style="text-align: center"><img src="http://bizwidgets.biz/images/htaccess.png" title="htaccess file in textmate" alt="htaccess file in textmate" border="0" height="305" width="575" /></p>
<p>Next, you want to create a controller. This will handle any processing you may require before sending a view to your visitor. Here, I have a controller called home.php</p>
<p>You need to create a class that extends Controller like this:</p>
<p><code>class Home extends Controller {</code></p>
<p><code>function Home() {<br />
parent::Controller();<br />
}</code></p>
<p><code>function index() {<br />
$this-&gt;load-&gt;view('home_view', $data);<br />
}</code></p>
<p><code>}</code></p>
<p>Now, you have a working controller. Next we will make a view for the home controller. Since we want to load the view &#8216;home_view&#8217;, we are going to create home_view.php in the views folder.</p>
<p style="text-align: center"><img src="http://bizwidgets.biz/images/view.png" title="View in CodeIgniter" alt="View in CodeIgniter" border="0" height="445" width="602" /></p>
<p>As you can see in the top of the HTML code, I like to create a header (and footer further down) for each one of my pages. Then I call the header and footer at the top and bottom of each page. This way, If I need to change something in the header, such as the page title or meta tags, I can do it on the header file once.</p>
<p>If you visit http://your-host-name/home your page should be working.</p>
<p>And, that&#8217;s it. Have fun with CodeIgniter. The forums are a great resource when you get stuck. Also check out the forum on mootools. The user guide included with CodeIgniter will also help you understand MVC programming and give you more instructions on how to use CI to its full advantage.</p>
<p>Thanks for reading! Tell me what you think!</p>
<p>Come back soon for Part 2 on MooTools.</p>
]]></content:encoded>
			<wfw:commentRss>http://bizwidgets.biz/blog/posts/build-your-first-web-20-app-with-php-ajax-and-codeigniter/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
