<?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>blog.wardonline</title>
	<atom:link href="http://blog.wardonline.be/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.wardonline.be</link>
	<description>Web Technology</description>
	<pubDate>Tue, 16 Dec 2008 07:52:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Ruby-style foreach in C#</title>
		<link>http://blog.wardonline.be/2008/12/15/ruby-style-foreach-in-c/</link>
		<comments>http://blog.wardonline.be/2008/12/15/ruby-style-foreach-in-c/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 22:07:30 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.wardonline.be/?p=33</guid>
		<description><![CDATA[Ben vorig jaar vooral met Ruby en Rails bezig geweest, en nu werkzaam als .Net Developer in C#.
Linq extenties bieden vanaf C# 2008 een hoop leuke functies zoals Select, Aggregate, etc. Â Eigenlijk alles om het werken met allerlei collecties behoorlijk te vergemakkelijken, vooral in combinatie met lambda expressies.
Maar 1 ding zat me dwars: waarom is [...]]]></description>
			<content:encoded><![CDATA[<p>Ben vorig jaar vooral met Ruby en Rails bezig geweest, en nu werkzaam als .Net Developer in C#.</p>
<p>Linq extenties bieden vanaf C# 2008 een hoop leuke functies zoals Select, Aggregate, etc. Â Eigenlijk alles om het werken met allerlei collecties behoorlijk te vergemakkelijken, vooral in combinatie met lambda expressies.</p>
<p>Maar 1 ding zat me dwars: waarom is er geen alternatieve foreach lus zoals in Ruby.</p>
<p>Voorbeeld:</p>
<div class="codesnip-container" >collection = ["hello", "world"]</p>
<p>collection.each do |item|</p>
<p>puts item</p>
<p>end</p></div>
<p>Dit doet hetzelfde als deze C# code:</p>
<div class="codesnip-container" >string[] collection = {&#8221;Hello&#8221;, &#8220;World&#8221;};</p>
<p>foreach (string item in collection)</p>
<p>{</p>
<p>Console.WriteLine(item);</p>
<p>}</p></div>
<p>Daarom heb ik uit nieuwsgierigheid dit proberen te bereiken in C# aan de hand van een eigen extensie en het is eigenlijk behoorlijk kort en eenvoudig om tot een erg praktisch resultaat te komen die werkt op alle standaard .NET collecties, arrays, etc&#8230;</p>
<p>De .cs-file: <a href="http://blog.wardonline.be/wp-content/uploads/2008/12/program.cs">EachIteratorExtention</a></p>
<pre><!--

Code highlighting produced by Actipro SyntaxEditor
http://www.ActiproSoftware.com/Products/DotNet/

--><span style="color: #0000FF;">using</span><span style="color: #000000;"> System;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Collections.Generic;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Linq;

</span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> EachExtensionExample
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> EachIteratorExtension
    {
        </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Each&lt;TSource&gt;(</span><span style="color: #0000FF;">this</span><span style="color: #000000;"> IEnumerable&lt;TSource&gt; source, Action&lt;TSource&gt; iterator)
        {
            </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;"> (TSource item </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> source) iterator(item);
        }
    }

    </span><span style="color: #0000FF;">internal</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> Program
    {
        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Main()
        {
            </span><span style="color: #0000FF;">string</span><span style="color: #000000;">[] collection = { </span><span style="color: #800000;">"Hello"</span><span style="color: #000000;">, </span><span style="color: #800000;">"World"</span><span style="color: #000000;"> };
            collection.Each(item =&gt; Console.WriteLine(item));

            Console.WriteLine();

            </span><span style="color: #008000;">//of meerdere lijnen</span><span style="color: #000000;">
            collection.Each(item =&gt;
            {
                Console.WriteLine(item);
                Console.WriteLine(item.ToUpper());
            });

            Console.WriteLine();

            </span><span style="color: #008000;">//maar hetzelfde werkt met zowat alle .NET collecties</span><span style="color: #000000;">
            </span><span style="color: #008000;">//enige vereiste is dat ze IEnumerable implementeren</span><span style="color: #000000;">
            var dates = </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> List&lt;DateTime&gt;();
            Enumerable.Range(</span><span style="color: #FF0000;">0</span><span style="color: #000000;">, </span><span style="color: #FF0000;">7</span><span style="color: #000000;">).Each(day =&gt; dates.Add(DateTime.Now.AddDays(day)));
            dates.Each(d =&gt; Console.WriteLine(d.DayOfWeek));

            var dates2 = </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> List&lt;DateTime&gt;() { DateTime.Now };
            var nestedList = </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> List&lt;List&lt;DateTime&gt;&gt; { dates, dates2 };
            nestedList.Each(list =&gt;
                Console.WriteLine(</span><span style="color: #800000;">"Dates in list: {0}"</span><span style="color: #000000;">, list.Count)
                );

            Console.ReadLine();
        }
    }
}</span></pre>
<p>Edit: Kleine update gedaan, het is zelfs niet nodig van een delegate te gebruiken.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2008/12/15/ruby-style-foreach-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Project Weeks, part 1</title>
		<link>http://blog.wardonline.be/2008/02/15/project-weeks-part-1/</link>
		<comments>http://blog.wardonline.be/2008/02/15/project-weeks-part-1/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 22:31:44 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.wardonline.be/2008/02/15/project-weeks-part-1/</guid>
		<description><![CDATA[This week was the first week of the &#8220;project weeks&#8221;, 3 weeks to go. In a group of 3 students we have to finish the project they give us.
In short, our project is a browser-based meal-application for a school.
They are using a very old DOS application right now and they really need an update.
Everybody works [...]]]></description>
			<content:encoded><![CDATA[<p>This week was the first week of the &#8220;project weeks&#8221;, 3 weeks to go. In a group of 3 students we have to finish the project they give us.</p>
<p>In short, our project is a browser-based meal-application for a school.<br />
They are using a very old DOS application right now and they really need an update.</p>
<p>Everybody works on the same project, using different languages and frameworks. The best implemantion will be used in the school. And I&#8217;m lucky: using Ruby On Rails.<br />
After 1 week we already have most of the functionality and a layout finished.</p>
<p>It&#8217;s kind of getting used to Rails 2, more things have changed than I though. Also I stopped using Eclipse as my IDE and now just use gEdit and the commandline.<br />
Why? It&#8217;s fast and I&#8217;m learning a whole lot more without an IDE helping me all the time. So far I haven&#8217;t even missed a visual debugger, hope it stays this way&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2008/02/15/project-weeks-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Yahoo Pipes &#038; Tweakers.net RSS: volledig artikel in de feed plaatsen</title>
		<link>http://blog.wardonline.be/2008/01/17/yahoo-pipes-tweakersnet-rss-volledig-artikel-in-de-feed-plaatsen/</link>
		<comments>http://blog.wardonline.be/2008/01/17/yahoo-pipes-tweakersnet-rss-volledig-artikel-in-de-feed-plaatsen/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 18:14:23 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://blog.wardonline.be/index.php/2008/01/17/yahoo-pipes-tweakersnet-rss-volledig-artikel-in-de-feed-plaatsen/</guid>
		<description><![CDATA[Tweakers.net bied enkel rss-feeds met kort stukje van het artikel in, en als extra af en toe reclame&#8230;
Maar sindskort heeft Yahoo Pipes een nieuwe module bij: Fetch Page. Deze maakt het wel erg makkelijk om, aan de hand van de originele feed, de artikels van de site in de feed te plaatsen.
Heb het even gedaan [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tweakers.net">Tweakers.net</a> bied enkel rss-feeds met kort stukje van het artikel in, en als extra af en toe reclame&#8230;</p>
<p>Maar sindskort heeft <a href="http://pipes.yahoo.com">Yahoo Pipes</a> een nieuwe module bij: Fetch Page. Deze maakt het wel erg makkelijk om, aan de hand van de originele feed, de artikels van de site in de feed te plaatsen.</p>
<p>Heb het even gedaan voor het nieuws en de meuktracker:</p>
<ul>
<li><a href="http://pipes.yahoo.com/wardonline/tweakersnet_nieuws_noads">Tweakers.net Nieuws, volledige artikels &amp; geen reclame</a></li>
<li><a href="http://pipes.yahoo.com/wardonline/tweakers_meuktracker">Tweakers.net Meuktracker, volledige artikels &amp; geen reclame</a></li>
</ul>
<p>De preview op yahoo pipes toont niet het volledige artikel, maar in een RSS reader staan ze volledig.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2008/01/17/yahoo-pipes-tweakersnet-rss-volledig-artikel-in-de-feed-plaatsen/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Feed me: Comics</title>
		<link>http://blog.wardonline.be/2007/12/28/feed-me-comics/</link>
		<comments>http://blog.wardonline.be/2007/12/28/feed-me-comics/#comments</comments>
		<pubDate>Fri, 28 Dec 2007 13:54:23 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[Personal]]></category>

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

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

		<guid isPermaLink="false">http://blog.wardonline.be/index.php/2007/12/28/feed-me-comics/</guid>
		<description><![CDATA[I have quite a lot of RSS feeds I read as some sort of daily routine. My feed-reader of choice has been Google Reader for some time now.
Today I&#8217;ll share all the online comics I&#8217;m reading. Other feeds will follow some day 
Feel free to introduce me to other comics.

Cyanide and Happiness  (Yahoo Pipe [...]]]></description>
			<content:encoded><![CDATA[<p>I have quite a lot of <a href="http://en.wikipedia.org/wiki/Rss">RSS feeds</a> I read as some sort of daily routine. My feed-reader of choice has been <a href="https://www.google.com/reader">Google Reader</a> for some time now.</p>
<p>Today I&#8217;ll share all the online comics I&#8217;m reading. Other feeds will follow some day <img src='http://blog.wardonline.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Feel free to introduce me to other comics.</p>
<ul>
<li><a href="http://www.explosm.net/comics">Cyanide and Happiness</a> <a href="http://feeds.feedburner.com/Explosm"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a> (<a href="http://pipes.yahoo.com/pipes/pipe.info?_id=a3384dfe858829fbb1eeff68b34fc0f1">Yahoo Pipe with images in feed</a>)</li>
<li><a href="http://www.dilbert.com/">Dilbert</a> <a href="http://feeds.feedburner.com/tapestrydilbert"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://www.johnandjohn.nl/">John and John</a> <a href="http://www.johnandjohn.nl/rss.php"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://www.lectrr.be/">Lectrr</a> <a href="http://www.lectrr.be/lectrrfeed.php"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://www.little-gamers.com">Little Gamers</a> <a href="http://www.little-gamers.com/rss.xml"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a> (<a href="http://wardonline.be/w/lgfeed.php">Images in feed</a>)</li>
<li><a href="http://nozzman.nl/">Nozzman</a> <a href="http://wardonline.be/w/nozzmanfeed.php"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://www.questionablecontent.net/">Questionable Content</a> <a href="http://www.rsspect.com/rss/95.xml"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://wallyandosborne.com/">Wally and Osborne</a> <a href="http://feeds.feedburner.com/wallyandosborne"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://www.wulffmorgenthaler.com/">Wulffmorgenthaler</a> <a href="http://feeds.feedburner.com/wulffmorgenthaler"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://xkcd.com">xkcd</a> <a href="http://www.xkcd.com/rss.xml"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://cad-comic.com/">Ctrl+Alt+Del</a> <a href="http://pipes.yahoo.com/pipes/pipe.run?_id=RJtEVqme3BGsphRWjknRlg&amp;_render=rss"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a> (Yahoo pipe with images in feed)</li>
<li><a href="http://dieselsweeties.com/">Diesel Sweeties</a> <a href="http://www.dieselsweeties.com/ds-unifeed.xml"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://comic.truenuff.com/">TrueNuff Comic</a> <a href="http://feeds.feedburner.com/truenuff_comic"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
<li><a href="http://www.vgcats.com/comics/">VG Cats</a> <a href="http://www.vgcats.com/vgcats.rdf.xml"><img src="http://blog.wardonline.be/wp-includes/images/rss.png" alt="Rss Feed" /></a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2007/12/28/feed-me-comics/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Merry Xmas And A Happy New Year</title>
		<link>http://blog.wardonline.be/2007/12/26/merry-xmas-and-a-happy-new-year/</link>
		<comments>http://blog.wardonline.be/2007/12/26/merry-xmas-and-a-happy-new-year/#comments</comments>
		<pubDate>Wed, 26 Dec 2007 16:27:56 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[MCT]]></category>

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

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

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

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

		<guid isPermaLink="false">http://blog.wardonline.be/index.php/2007/12/26/merry-xmas-and-a-happy-new-year/</guid>
		<description><![CDATA[Kind of hard to concentrate on all these important projects I&#8217;m working on right now during the holidays (and my birthday too  ), but a man&#8217;s gotta do what a man&#8217;s gotta do.
What projects am I talking about?

a web shop for movies (Java Server Faces, Ajax4JSF, Hibernate and some other libraries)
Gamers Initiative, a community [...]]]></description>
			<content:encoded><![CDATA[<p>Kind of hard to concentrate on all these important projects I&#8217;m working on right now during the holidays (and my birthday too <img src='http://blog.wardonline.be/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ), but a man&#8217;s gotta do what a man&#8217;s gotta do.<br/><br />
What projects am I talking about?</p>
<ul>
<li>a web shop for movies (Java Server Faces, Ajax4JSF, Hibernate and some other libraries)</li>
<li>Gamers Initiative, a community site for game developers and gamers (Ruby On Rails)</li>
<li>an advertisement site, let users create advertisements and submit them to magazines and/or newspapers . (ASP.NET, C#)</li>
<li>creating a little experiment (some kind of poll) for the thesis my girlfriend is writing. I&#8217;ve been experimenting with some PHP frameworks, but haven&#8217;t decided which one I&#8217;ll use. So far Symphony (MVC-framework) and Prado (framework similar to ASP.NET) are fun and fast to use, though they both are very different. <br/><br />
I also tried Zend Framework and CodeIgniter, but they got me less excited. I don&#8217;t like the way database abstraction is done in Zend, and CodeIgniter is too limited in several ways.</li>
</ul>
<p>A bit late for Christmas, but I&#8217;d like to say: a merry Christmas and a happy new year. I wish you all a good health, lots of love, a good web year and everything else you might need.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2007/12/26/merry-xmas-and-a-happy-new-year/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Code example: Search Engine, Bookmark &#038; Usability Friendly Ajax</title>
		<link>http://blog.wardonline.be/2007/12/08/code-example-search-engine-bookmark-usability-friendly-ajax/</link>
		<comments>http://blog.wardonline.be/2007/12/08/code-example-search-engine-bookmark-usability-friendly-ajax/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 17:07:24 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

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

		<guid isPermaLink="false">http://blog.wardonline.be/index.php/2007/12/08/code-example-search-engine-bookmark-usability-friendly-ajax/</guid>
		<description><![CDATA[An big problem with loading content in your page with javascript, is that this content can&#8217;t be seen by search-engines.
But this problem can be overcome, see this little code example I wrote.
What can this do?

All pages can be used with Javascript disable
You can bookmark a page that was loaded with javascript, thanks to RHS
The back [...]]]></description>
			<content:encoded><![CDATA[<p>An big problem with loading content in your page with javascript, is that this content can&#8217;t be seen by search-engines.<br />
But this problem can be overcome, see this little code example I wrote.</p>
<p>What can this do?</p>
<ul>
<li>All pages can be used with Javascript disable</li>
<li>You can bookmark a page that was loaded with javascript, thanks to RHS</li>
<li>The back and forward buttons of the browser are still functional</li>
</ul>
<p>To write this, I used the <a href="http://jquery.com/">jQuery javascript framework</a> and the <a href="http://code.google.com/p/reallysimplehistory/">RHS library</a></p>
<p>You can <a href="http://wardonline.be/lab/friendly_ajax/">test the example online</a>. Or <a href="http://wardonline.be/lab/friendly_ajax/friendly_ajax.zip">download it</a>.</p>
<p><span id="more-25"></span></p>
<h3>ajaxsite.php</h3>
<p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">&lt;?php</span><br />
<span class="kw2">class</span> Page<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; public <span class="re0">$link</span>, <span class="re0">$title</span>, <span class="re0">$content</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; public <span class="kw2">function</span> __construct<span class="br0">&#40;</span><span class="re0">$link</span>, <span class="re0">$title</span>, <span class="re0">$content</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">link</span> = <span class="re0">$link</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">title</span> = <span class="re0">$title</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">content</span> = <span class="re0">$content</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">class</span> AjaxSite<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * All pages of the site<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @var array<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; private <span class="re0">$pages</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Holds the current page to display<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @var Page<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; private <span class="re0">$currentPage</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * The default page<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @var string<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; private <span class="re0">$defaultLink</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Contructor, set example pages<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param $default_link<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; public <span class="kw2">function</span> __construct<span class="br0">&#40;</span><span class="re0">$default_link</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">defaultLink</span> = <span class="re0">$default_link</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//some placeholder text</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$lorum</span> = &lt;&lt;&lt;LOR<br />
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas faucibus malesuada elit. Nulla et ipsum. In sed lacus. Donec eleifend neque. Nullam et tellus et dui tincidunt rhoncus.&lt;/p&gt;&lt;p&gt; Donec imperdiet ante eget massa. Nunc eu urna sit amet nisl pellentesque faucibus. Pellentesque suscipit porta elit. Praesent ac tellus ut quam pellentesque faucibus.&lt;/p&gt;<br />
LOR;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//create a couple of pages</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$p1</span> = <span class="kw2">new</span> Page<span class="br0">&#40;</span><span class="st0">&#8220;page1&#8243;</span>, <span class="st0">&#8220;Page 1&#8243;</span>,<span class="st0">&#8220;&lt;h3&gt;This is page 1&lt;/h3&gt;&#8221;</span> . <span class="re0">$lorum</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$p2</span> = <span class="kw2">new</span> Page<span class="br0">&#40;</span><span class="st0">&#8220;page2&#8243;</span>, <span class="st0">&#8220;Page 2&#8243;</span>,<span class="st0">&#8220;&lt;h3&gt;This is page 2&lt;/h3&gt;&#8221;</span> . <span class="re0">$lorum</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$p3</span> = <span class="kw2">new</span> Page<span class="br0">&#40;</span><span class="st0">&#8220;page3&#8243;</span>, <span class="st0">&#8220;Page 3&#8243;</span>,<span class="st0">&#8220;&lt;h3&gt;This is page 3&lt;/h3&gt;&#8221;</span> . <span class="re0">$lorum</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//put the pages in an array, use the page link as key for easier searching</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$pages</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$p1</span>-&gt;<span class="me1">link</span> =&gt; <span class="re0">$p1</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$p2</span>-&gt;<span class="me1">link</span> =&gt; <span class="re0">$p2</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$p3</span>-&gt;<span class="me1">link</span> =&gt; <span class="re0">$p3</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">setPages</span><span class="br0">&#40;</span><span class="re0">$pages</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Set all Pages<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @param array $pages<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; public <span class="kw2">function</span> setPages<span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a> <span class="re0">$pages</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">pages</span> = <span class="re0">$pages</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get all Pages<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return array<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; public <span class="kw2">function</span> getPages<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">pages</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get the current page to show<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return Page<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; public <span class="kw2">function</span> getCurrentPage<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//if currentPage is already set, return it</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$this</span>-&gt;<span class="me1">currentPage</span> != <span class="kw2">null</span><span class="br0">&#41;</span> <span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">currentPage</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//get page link for page to show</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$link</span> = <span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#8220;p&#8221;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$link</span> != <span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//if link exists in the array of pages, use it, otherwise use the default</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$link</span> = <a href="http://www.php.net/array_key_exists"><span class="kw3">array_key_exists</span></a><span class="br0">&#40;</span><span class="re0">$link</span>,<span class="re0">$this</span>-&gt;<span class="me1">pages</span><span class="br0">&#41;</span>? <span class="re0">$link</span> : <span class="re0">$this</span>-&gt;<span class="me1">defaultLink</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//set the current page</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">currentPage</span> = <span class="re0">$this</span>-&gt;<span class="me1">pages</span><span class="br0">&#91;</span><span class="re0">$link</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//if the link is not set, use the default</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$this</span>-&gt;<span class="me1">currentPage</span> = <span class="re0">$this</span>-&gt;<span class="me1">pages</span><span class="br0">&#91;</span><span class="re0">$this</span>-&gt;<span class="me1">defaultLink</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">currentPage</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Get default link for this page<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return string<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; public <span class="kw2">function</span> getDefaultLink<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$this</span>-&gt;<span class="me1">defaultLink</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * Check if this page is not an ajax request<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; *<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; * @return bool<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; */</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; public <span class="kw2">function</span> notAjaxRequest<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//default return value</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$notAjaxRequest</span> = <span class="kw2">true</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//get type of request</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$request</span> = <span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#8220;r&#8221;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//if request type is ajax, only echo partial content</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$request</span> != <span class="kw2">null</span> &amp;&amp; <span class="re0">$request</span> == <span class="st0">&#8220;ajax&#8221;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&#8220;&lt;h2&gt;&#8221;</span> . <span class="re0">$this</span>-&gt;<span class="me1">getCurrentPage</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me1">title</span> . <span class="st0">&#8220;&lt;/h2&gt;&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$this</span>-&gt;<span class="me1">getCurrentPage</span><span class="br0">&#40;</span><span class="br0">&#41;</span>-&gt;<span class="me1">content</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$notAjaxRequest</span> = <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$notAjaxRequest</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<h3>index.php</h3>
<p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><span class="kw2">&lt;</span></a>?php<br />
require_once <span class="st0">&#8220;ajaxsite.php&#8221;</span>;</p>
<p>// create new site<br />
$app = new AjaxSite<span class="br0">&#40;</span><span class="st0">&#8216;page1&#8242;</span><span class="br0">&#41;</span>;</p>
<p>//only show full page when this page is not an ajax request<br />
if<span class="br0">&#40;</span>$app-<span class="kw2">&gt;</span></a></span>notAjaxRequest()):<br />
?&gt;<br />
<span class="sc0">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span><br />
<span class="sc2"><a href="http://december.com/html/4/element/html.html"><span class="kw2">&lt;html</span></a> xmlns=<span class="st0">&#8220;http://www.w3.org/1999/xhtml&#8221;</span><span class="kw2">&gt;</span></a></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/head.html"><span class="kw2">&lt;head&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/meta.html"><span class="kw2">&lt;meta</span></a> <span class="kw3">http-equiv</span>=<span class="st0">&#8220;Content-Type&#8221;</span> <span class="kw3">content</span>=<span class="st0">&#8220;text/html; charset=iso-8859-1&#8243;</span> /<span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/title.html"><span class="kw2">&lt;title&gt;</span></a></span>Search Engine <span class="sc1">&amp; Usability friendly Ajax&lt;/title&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;script type=&quot;text/javascript&quot; src=&quot;json2007.js&quot;&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;script type=&quot;text/javascript&quot; src=&quot;rsh.js&quot;&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;script type=&quot;text/javascript&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211;<br />
&nbsp; &nbsp; &nbsp; &nbsp; //set default page, used in main.js<br />
&nbsp; &nbsp; &nbsp; &nbsp; var defaultpage=&quot;&lt;?php echo $app-&gt;getDefaultLink() ?&gt;&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; //&#8211;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/script&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/script.html"><span class="kw2">&lt;script</span></a> <span class="kw3">type</span>=<span class="st0">&#8220;text/javascript&#8221;</span> <span class="kw3">src</span>=<span class="st0">&#8220;main.js&#8221;</span><span class="kw2">&gt;</span></a></span><span class="sc2"><span class="kw2">&lt;/script&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/head&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/body.html"><span class="kw2">&lt;body&gt;</span></a></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">&#8220;container&#8221;</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/h1.html"><span class="kw2">&lt;h1&gt;</span></a></span>Search Engine <span class="sc1">&amp;amp;</span> Usability Friendly Ajax<span class="sc2"><span class="kw2">&lt;/h1&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">style</span>=<span class="st0">&#8220;height:10px;&#8221;</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/img.html"><span class="kw2">&lt;img</span></a> <span class="kw3">id</span>=<span class="st0">&#8220;loader&#8221;</span> <span class="kw3">src</span>=<span class="st0">&#8220;ajax-loader.gif&#8221;</span> <span class="kw3">alt</span>=<span class="st0">&#8220;Loading&#8230;&#8221;</span> <span class="kw3">style</span>=<span class="st0">&#8220;display:none;&#8221;</span> /<span class="kw2">&gt;</span></a></span><span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">&#8220;nav&#8221;</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/ul.html"><span class="kw2">&lt;ul&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;</span></a>?php foreach<span class="br0">&#40;</span>$app-<span class="kw2">&gt;</span></a></span>getPages() as $link=&gt;$page): ?&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/li.html"><span class="kw2">&lt;li&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/a.html"><span class="kw2">&lt;a</span></a> <span class="kw3">id</span>=<span class="st0">&#8220;_&lt;?php echo $link ?&gt;</span>&quot; href=&quot;<span class="sc2">&lt;?php echo &#8216;index.php?p=&#8217; . $link ?&gt;</span>&quot;&gt;<span class="sc2">&lt;?php echo $page-&gt;</span>title ?&gt;<span class="sc2">&lt;/a&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;/li&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;?php endforeach; ?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;/ul&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;div id=&#8221;</span><span class="kw3">content</span><span class="st0">&#8220;&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;?php echo $app-&gt;</span>getCurrentPage()-&gt;content ?&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;/div&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;/div&gt;</span><br />
<span class="sc2">&lt;/body&gt;</span><br />
<span class="sc2">&lt;/html&gt;</span><br />
<span class="sc2">&lt;?php endif; //And that&#8217;s it <img src='http://blog.wardonline.be/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ?&gt;</span> </span></div>
</div>
<h3>main.js</h3>
<p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">var</span> loc = <span class="st0">&#8220;&#8221;</span> + window.<span class="me1">location</span>;</p>
<p><span class="co1">//create dhtmlHistory, so we can store the browser history for this site</span><br />
window.<span class="me1">dhtmlHistory</span>.<span class="me1">create</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">//event when browser history buttons are clicked</span><br />
<span class="kw2">var</span> yourListener = <span class="kw2">function</span><span class="br0">&#40;</span>newLocation, historyData<span class="br0">&#41;</span> <br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//newLocation contains the current page location (for example &quot;page1&quot;)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//historyData contains the html for the current page that I saved with dhtmlHistory.add(loc,content)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#8220;#content&#8221;</span><span class="br0">&#41;</span>.<span class="me1">html</span><span class="br0">&#40;</span>historyData<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="br0">&#125;</span></p>
<p><span class="co1">//executed when DOM is ready</span><br />
$<span class="br0">&#40;</span>document<span class="br0">&#41;</span>.<span class="me1">ready</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span>&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//initialize dhtml history and set the event for all history changes</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; dhtmlHistory.<span class="me1">initialize</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; dhtmlHistory.<span class="me1">addListener</span><span class="br0">&#40;</span>yourListener<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//set location of current page in global var, so it can be used in all events</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; loc = <span class="st0">&#8220;&#8221;</span> + window.<span class="me1">location</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> lastIndex = loc.<span class="me1">lastIndexOf</span><span class="br0">&#40;</span><span class="st0">&#8220;#&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; loc = <span class="br0">&#40;</span>lastIndex != -<span class="nu0">1</span><span class="br0">&#41;</span>?<span class="br0">&#40;</span>loc.<span class="me1">substring</span><span class="br0">&#40;</span>lastIndex + <span class="nu0">1</span><span class="br0">&#41;</span><span class="br0">&#41;</span>:defaultpage;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//load the content for the first page based on the current location </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//for example &quot;page3&quot;, this makes bookmarking an &quot;ajax&quot; page possible</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#8220;#content&#8221;</span><span class="br0">&#41;</span>.<span class="me1">load</span><span class="br0">&#40;</span><span class="st0">&#8220;index.php?p=&#8221;</span> + loc + <span class="st0">&#8220;&amp;r=ajax&#8221;</span>, <span class="kw2">null</span>, <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> content = $<span class="br0">&#40;</span><span class="st0">&#8220;#content&#8221;</span><span class="br0">&#41;</span>.<span class="me1">html</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dhtmlHistory.<span class="me1">add</span><span class="br0">&#40;</span>loc,content<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Everytime and ajax request starts, we show the loading animation and hide the old content</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#8220;#content&#8221;</span><span class="br0">&#41;</span>.<span class="me1">ajaxStart</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span>&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#8220;#loader&#8221;</span><span class="br0">&#41;</span>.<span class="me1">show</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">hide</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Everytime and ajax request is succesfull, we hide the loading animation again</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//and show the new content with a fade in animation</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#8220;#content&#8221;</span><span class="br0">&#41;</span>.<span class="me1">ajaxSuccess</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span>evt, request, settings<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#8220;#loader&#8221;</span><span class="br0">&#41;</span>.<span class="me1">hide</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">fadeIn</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//we set a click event for all link in the navigation</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#8220;#nav li a&#8221;</span><span class="br0">&#41;</span>.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//I saved the page link in the id of the hyperlink</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//though I could also just parse the src and get it from there</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loc = $<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">attr</span><span class="br0">&#40;</span><span class="st0">&#8220;id&#8221;</span><span class="br0">&#41;</span>.<span class="me1">substring</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//load the new content in the content div</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#8220;#content&#8221;</span><span class="br0">&#41;</span>.<span class="me1">load</span><span class="br0">&#40;</span>$<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">attr</span><span class="br0">&#40;</span><span class="st0">&#8220;href&#8221;</span><span class="br0">&#41;</span> + <span class="st0">&#8220;&amp;r=ajax&#8221;</span>,<span class="kw2">null</span>, <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//everytime we load new content with ajax</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//we put it in the dhtmlHistory object, so we can recover it later</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dhtmlHistory.<span class="me1">add</span><span class="br0">&#40;</span>loc,$<span class="br0">&#40;</span><span class="kw1">this</span><span class="br0">&#41;</span>.<span class="me1">html</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//return false when the hyperlink is clicked, to disable </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//the default behavior of the hyperlink</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;&nbsp; <br />
<span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2007/12/08/code-example-search-engine-bookmark-usability-friendly-ajax/feed/</wfw:commentRss>
		</item>
		<item>
		<title>We Seem To Have Misplaced Our Igloo - Demo Release @ Den Trap</title>
		<link>http://blog.wardonline.be/2007/11/26/we-seem-to-have-misplaced-our-igloo-demo-release-den-trap/</link>
		<comments>http://blog.wardonline.be/2007/11/26/we-seem-to-have-misplaced-our-igloo-demo-release-den-trap/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 20:19:48 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://blog.wardonline.be/index.php/2007/11/26/we-seem-to-have-misplaced-our-igloo-demo-release-den-trap/</guid>
		<description><![CDATA[ Yesterday went to see We Seem To Have Misplaced Our Igloo at Den Trap in Kortrijk. A local upcoming indie band that just released there first demo.
This was the second time I saw them perform, and they made a lot of progress in very short time. Yes, I&#8217;m a fan already.
Bought the demo for [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/2007/07/m_86077e968c8c866412ff188dcb87ecf3.png" alt="We Seem To Have Misplaced Our Igloo" style="float: right;margin:10px" /> Yesterday went to see <a href="http://www.myspace.com/weseemtohave">We Seem To Have Misplaced Our Igloo</a> at <a href="http://www.myspace.com/dentrap">Den Trap in Kortrijk</a>. A local upcoming indie band that just released there first demo.</p>
<p>This was the second time I saw them perform, and they made a lot of progress in very short time. Yes, I&#8217;m a fan already.</p>
<p>Bought the demo for just &#8364;5 and it&#8217;s definitly worth the money, check them out at there next gig!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2007/11/26/we-seem-to-have-misplaced-our-igloo-demo-release-den-trap/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A fast guy in tights and a movie about coffee</title>
		<link>http://blog.wardonline.be/2007/11/16/a-fast-guy-in-tights-and-a-movie-about-coffee/</link>
		<comments>http://blog.wardonline.be/2007/11/16/a-fast-guy-in-tights-and-a-movie-about-coffee/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 22:01:14 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[comic]]></category>

		<guid isPermaLink="false">http://blog.wardonline.be/index.php/2007/11/16/a-fast-guy-in-tights-and-a-movie-about-coffee/</guid>
		<description><![CDATA[I&#8217;m reading a lot of daily comics and this one is just too hilarious.

dilbert.com
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m reading a lot of daily comics and this one is just too hilarious.</p>
<p><img src='http://blog.wardonline.be/wp-content/uploads/2008/02/125221_1827728535.jpg' alt='A fast guy' /></p>
<p><a href="http://www.dilbert.com">dilbert.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2007/11/16/a-fast-guy-in-tights-and-a-movie-about-coffee/feed/</wfw:commentRss>
		</item>
		<item>
		<title>45 days later: Likes and Dislikes</title>
		<link>http://blog.wardonline.be/2007/11/15/45-days-later-likes-and-dislikes/</link>
		<comments>http://blog.wardonline.be/2007/11/15/45-days-later-likes-and-dislikes/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 23:07:03 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[MCT]]></category>

		<guid isPermaLink="false">http://blog.wardonline.be/index.php/2007/11/15/45-days-later-likes-and-dislikes/</guid>
		<description><![CDATA[Likes

Rails is fun and fast
LINQ for SQL &#62; Hibernate
ASP.NET project is on the roll
No more Visual Basic
Projects instead of exams (Rails, ASP.NET)

Dislikes

Debugging &#8220;Java Server Faces&#8221; is a nightmare
The JSP configuration files suck.
Writing tests in Rails is boring
Need more sleep
Doing layout stuff
Small Business Project
Not having time to work on personal projects
ASP.NET ProfileProvider not working in WebApplications

]]></description>
			<content:encoded><![CDATA[<p><strong>Likes</strong></p>
<ul>
<li>Rails is fun and fast</li>
<li>LINQ for SQL &gt; Hibernate</li>
<li>ASP.NET project is on the roll</li>
<li>No more Visual Basic</li>
<li>Projects instead of exams (Rails, ASP.NET)</li>
</ul>
<p><strong>Dislikes</strong></p>
<ul>
<li>Debugging &#8220;Java Server Faces&#8221; is a nightmare</li>
<li>The JSP configuration files suck.</li>
<li>Writing tests in Rails is boring</li>
<li>Need more sleep</li>
<li>Doing layout stuff</li>
<li>Small Business Project</li>
<li>Not having time to work on personal projects</li>
<li>ASP.NET ProfileProvider not working in WebApplications</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2007/11/15/45-days-later-likes-and-dislikes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>To teach PHP or not to teach PHP, that&#8217;s the question</title>
		<link>http://blog.wardonline.be/2007/09/27/to-teach-php-or-not-to-teach-php-thats-the-question/</link>
		<comments>http://blog.wardonline.be/2007/09/27/to-teach-php-or-not-to-teach-php-thats-the-question/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 20:22:45 +0000</pubDate>
		<dc:creator>Ward</dc:creator>
		
		<category><![CDATA[MCT]]></category>

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

		<guid isPermaLink="false">http://blog.wardonline.be/index.php/2007/09/27/to-teach-php-or-not-to-teach-php-thats-the-question/</guid>
		<description><![CDATA[Yesterday, I heard from 2 teachers they wanted to remove PHP from the MCT curriculum. So now, the new academic year has started en it seems that PHP is reduced to a total of 3 lessons (during 2MCT)&#8230;
Also, when you do a specialization in web technology during the final year, you don&#8217;t have a PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I heard from 2 teachers they wanted to remove PHP from the MCT curriculum. So now, the new academic year has started en it seems that PHP is reduced to a total of 3 lessons (during 2MCT)&#8230;</p>
<p>Also, when you do a specialization in web technology during the final year, you don&#8217;t have a PHP course anymore since it&#8217;s been replaced by Ruby On Rails.</p>
<p>Why? This is what they had to say:</p>
<blockquote><p>Big company&#8217;s and corporations told us they had no need for PHP. It&#8217;s too simple, dirty and too hard to maintain for their needs.</p></blockquote>
<p>Are these companies underestimating the future of PHP or not?<br />
I think there are several reasons to continue teaching PHP in MCT, and several not to.</p>
<p>Pros:</p>
<ul>
<li>PHP is all over the place. Most of the websites you come across on the web are written in PHP. And it will stay that way, for many years to come.</li>
<li>Hosting PHP on a Linux server is cheap and easy. It&#8217;s affordable even for small busnisses.</li>
<li>The amount of PHP-frameworks using the MVC-principals is growing fast, and they are getting better and bigger. They make PHP-websites a lot faster to create, a lot easier to maintain and easier to expand on.</li>
<li>Not all MCT-students will end up in a big company. (right?)</li>
</ul>
<p>Cons:</p>
<ul>
<li>Once you have a decent knowledge of several languages/frameworks (like J2EE, ASP.NET and RoR), it&#8217;s pretty easy to learn PHP yourself.</li>
<li>There&#8217;s not &#8220;that&#8221; much you can learn about PHP in school. Most of it will come through experience. J2EE, .NET and RoR on the other hand are much more complex, capacious and broad. So they are a lot harder to learn by yourself.</li>
<li>Testing.</li>
<li>Reusing business logic code from company programs in your website, without rewriting it in another language.</li>
</ul>
<p>So I&#8217;m not really against their decision about PHP in MCT, but I do think PHP has a bright future (even for bigger business applications).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wardonline.be/2007/09/27/to-teach-php-or-not-to-teach-php-thats-the-question/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

