<?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>Northern Binary &#187; Web development</title>
	<atom:link href="http://blog.northernbinary.org/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.northernbinary.org</link>
	<description></description>
	<lastBuildDate>Thu, 11 Mar 2010 10:16:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CodeIgniter and Controllers structure</title>
		<link>http://blog.northernbinary.org/php/codeigniter-and-controllers-structure/</link>
		<comments>http://blog.northernbinary.org/php/codeigniter-and-controllers-structure/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 21:58:14 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://blog.northernbinary.org/?p=40</guid>
		<description><![CDATA[Over the weekend I was playing around with CodeIgniter. I was up and running pretty quickly and it all seemed to go pretty smoothly. Having built web applications and web sites for a number of years now and before that desktop applications etc, I&#8217;m usually pretty quick with establishing a technical structure for my site. [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I was playing around with <a href="http://www.codeigniter.com" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/www.codeigniter.com');">CodeIgniter</a>. I was up and running pretty quickly and it all seemed to go pretty smoothly. Having built web applications and web sites for a number of years now and before that desktop applications etc, I&#8217;m usually pretty quick with establishing a technical structure for my site. I do this because I tend to work in iterations rather than focusing on one specific thing before moving on the next. Anyway, I became a bit frustrated when I noticed that I couldn&#8217;t subdivide my controllers folder. It seemed that I could only have one big pool of controllers. This was no good. I checked the documentation and at first I didn&#8217;t notice <a href="http://codeigniter.com/user_guide/general/controllers.html#subfolders" target="_blank" onclick="javascript:pageTracker._trackPageview ('/outbound/codeigniter.com');">the section that describes how to divide your controllers folder into sub folders</a>. When I finally had figured it out I ran into the next problem.</p>
<p>My site has a top level menu option called &#8216;Settings&#8217;. When you click &#8216;Settings&#8217; I want to execute the &#8217;settings&#8217; controller located in the controllers/ folder. The Settings page however has more sub-options like Users, Groups, Roles etc. and I want all these controllers to live inside a settings/ folder that&#8217;s located in the controllers/ folder:</p>
<pre>+ controllers/
   +settings/
      -users.php
      -groups.php
      -roles.php
   -settings.php</pre>
<p>This was going to clash. Going to the <em>localhost/myapp/settings</em> URL would execute the &#8217;settings&#8217; controller and going to <em>localhost/myapp/settings/users</em> would bring up a 404 error page. I assume this is because the framework tries to execute a method called &#8216;users&#8217; inside the &#8217;settings&#8217; controller.</p>
<p>Going back and forth with this issue I finally figured out a way to overcome this problem. In the routes.php configuration file you can set a default controller to execute. I&#8217;ve set mine to &#8216;index&#8217;. So, this could mean that if I would bring my settings.php file holder the Settings controller into the settings/ folder and rename it to index.php, it might execute that controller when browsing to <em>localhost/mysite/settings</em>. And behold, it does. the structure I ended up with was:</p>
<pre>+ controllers/
   +settings/
      -index.php  &lt;- default controller
      -users.php
      -groups.php
      -roles.php</pre>
<p>I haven&#8217;t tried this yet with deeper structures but I assume that the same idea applies to that as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/php/codeigniter-and-controllers-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP</title>
		<link>http://blog.northernbinary.org/php/php/</link>
		<comments>http://blog.northernbinary.org/php/php/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 22:44:03 +0000</pubDate>
		<dc:creator>Luke</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://blog.opject.org/?p=28</guid>
		<description><![CDATA[I used to hate PHP. I still do actually, even if it&#8217;s only just a bit. But, over the past year or so I&#8217;ve developed an appreciation for the language. OK, as a programming language it is pretty odd. I mean that syntax, c&#8217;mon. Some weird demon child offspring between C and Perl. It&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>I used to hate PHP. I still do actually, even if it&#8217;s only just a bit. But, over the past year or so I&#8217;ve developed an appreciation for the language. OK, as a programming language it is pretty odd. I mean that syntax, c&#8217;mon. Some weird demon child offspring between C and Perl. It&#8217;s a pretty hideous creature. Furthermore, PHP cannot be considered a platform like .NET or J2EE. It&#8217;s a programming language, nothing more and nothing less. Anything you can code with PHP can be done in as many different ways as there are PHP programmers. In a way it reminds me of the good old C days. C came with a massive library of incoherent functions. E.g. with C there where multiple of different ways of working with files. You use the set of functions that would make to most sense to you. In a sense, the biggest difference between PHP and C is the lack of pointers&#8230;</p>
<p>I believe that the power of PHP doesn&#8217;t lay in the programming language itself, because any serious programmer can confirm that the language is pretty frustrating to work with on a day to day basis. No, the power of PHP lies in its availability. A programming environment like ColdFusion, Java or even .NET is much more powerful and structured. Not that you can do more with these languages than with PHP, but it provides a common ground for programmers to start off with. The problem with ColdFusion and Java is that you can&#8217;t get it hosted, unless you&#8217;re willing to shell out the big bucks. Most providers offer Windows hosting so hosting ASP isn&#8217;t outside the reach of small time web developers and whipping up some old school ASP isn&#8217;t that much different than doing PHP. With .NET that&#8217;s a different story. Unfortunately, to <u>effectively</u> develop for .NET you need the Visual Studio development environment which you can buy for lots of money from Microsoft, making the platform unavailable for a large group of developers. I&#8217;m sure Micorsoft provides a stripped command-line SDK, but that doesn&#8217;t make the environment more approachable for people who don&#8217;t have the budget to buy Visual Studio.</p>
<p>The typical web developer likes PHP because every cheap hosting enviroment has at least PHP 4. And even though PHP 4 lacks some OO functionality, you can create pretty good applications with it. Other than that, there is so much information available for PHP available that&#8217;s being able to be grasped by not only the hard-core coders but also the the guy who just wants to store some stuff in a database and doesn&#8217;t want to get to much involved in the details of the language. Because of this, there are a lot of web developers using PHP. Which in turn means that a lot of companies use it because it has a large resource pool. So, even though PHP isn&#8217;t the most elegant programming language, it is popular because of these reasons.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.northernbinary.org/php/php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
