<?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>Kerkness.ca &#187; Tutorials</title>
	<atom:link href="http://www.kerkness.ca/content/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerkness.ca</link>
	<description>flexing my kerkness, among other things</description>
	<lastBuildDate>Wed, 14 Oct 2009 15:12:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dynamically add row to a table using PHP and Mootools</title>
		<link>http://www.kerkness.ca/add-row-to-table/</link>
		<comments>http://www.kerkness.ca/add-row-to-table/#comments</comments>
		<pubDate>Mon, 25 May 2009 19:44:54 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[injection]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=529</guid>
		<description><![CDATA[This short cross browser example will show you how to dynamically add rows to a table using PHP and Mootools.
The Files

table_form.html  ::  This is our main HTML file.  It contains a HTML Table and a simple Form.
table_form.php :: This is the php file which will process the form and return results back to our HTML [...]]]></description>
			<content:encoded><![CDATA[<p>This short cross browser example will show you how to dynamically add rows to a table using PHP and Mootools.</p>
<h2>The Files</h2>
<ul>
<li>table_form.html  ::  This is our main HTML file.  It contains a HTML Table and a simple Form.</li>
<li>table_form.php :: This is the php file which will process the form and return results back to our HTML page</li>
<li><a href="http://kerkness.ca/moo/table_form/table_form.js">table_form.js</a> :: This is the Javascript file which will handle submitting data to php and handle the response</li>
<li>table_form.css :: basic css file to add styling</li>
</ul>
<p><a href="http://kerkness.ca/moo/table_form/table_form.html">View a Demo</a></p>
<p><a href="http://kerkness.ca/moo/table_form/table_form.zip">Download the full Source</a></p>
<p>I&#8217;ve tried to add detailed comments to the source code but if you have any questions just post them in the comments.</p>
<h2>The Bare Bones : Row Injection</h2>
<p>For those who are only interested in the table row injection here is a function which will get the job done and is crossbrowser. If you find otherwise let me know. The key here is instead of creating individual elements for tr and td and injecting them into the table, you create a full table element with a single row and inject that into your table.</p>
<pre name="code" class"js">
var inject_row = function( table, data )
{
    var str = '';
    data.each(function(item, index){
        str += '&lt;td&gt;'+item+'&lt;/td&gt;';
    });
    var tr = new Element('div', {
        html: '&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;' + str + '&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;'
    }).getElement('tr');
    tr.inject( table );
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/add-row-to-table/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hot Flash Alert :: An Alert Box using Mootools</title>
		<link>http://www.kerkness.ca/mootools-alert-box/</link>
		<comments>http://www.kerkness.ca/mootools-alert-box/#comments</comments>
		<pubDate>Sat, 23 May 2009 17:29:16 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=507</guid>
		<description><![CDATA[I&#8217;ve been playing around with mootools and have created a little alert box called &#8220;Hot Flash Alert&#8221; which can be handy for flashing confirmation messages to a user or informing them of input errors.
Example
Show Alert then Fade
Show Alert
To use Hot Flash Alert in your web site you&#8217;ll need to complete a few simple steps.
Step 1 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with mootools and have created a little alert box called &#8220;Hot Flash Alert&#8221; which can be handy for flashing confirmation messages to a user or informing them of input errors.</p>
<h2>Example</h2>
<p><a id="hot_flash_fade_out_button" href="#">Show Alert then Fade</a></p>
<p><a id="hot_flash_button" href="#">Show Alert</a></p>
<p>To use Hot Flash Alert in your web site you&#8217;ll need to complete a few simple steps.</p>
<h2>Step 1 : Include the required Javascript and CSS files in your web site header.</h2>
<p>The Hot Flash Alert requires <a href="http://ajax.googleapis.com/ajax/libs/mootools/1.2.1/mootools-yui-compressed.js">Mootools.js</a>, <a href="http://kerkness.ca/hot_flash/hot_flash.js">hot_flash.js</a>, and <a href="http://kerkness.ca/hot_flash/hot_flash.css">hot_flash.css</a> .</p>
<h2>Step 2 : Add the Alert Box DIV to your theme</h2>
<p>The Hot Flash Alert is actually a div which sits in your web page until it is called.  It&#8217;s probably best to stick the div at the bottom of your web page so that it displays on top of any other absolutely positioned elements.</p>
<pre>
&lt;div id="alert_box"&gt;
   &lt;div id="alert_head"&gt;
      &lt;a id="alert_box_x" href="#"&gt;close&lt;/a&gt;
   &lt;/div&gt;
   &lt;div id="alert_box_message"&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<p>You can customize the DIV anyway you want but it will require all four elements &#8216;alert_box&#8217;, &#8216;alert_head&#8217;, &#8216;alert_box_x&#8217; and &#8216;alert_box_message&#8217;.  The styling of these elements is handled by the <a href="http://kerkness.ca/hot_flash/hot_flash.css">hot_flash.css</a> file.</p>
<h2>Step 3 :  Call the hot_flash() javascript method</h2>
<p>Once all the pieces are in place you can pop open the Hot Flash Alert by calling the hot_flash() javacript method. </p>
<pre>
 // text = the message that will be displayed
 // duration (optional) milliseconds to fade out the alert
 hot_flash( text, duration );
</pre>
<p>Here are some examples.</p>
<pre>
  // simple alert that fades out on it's own
  // over 2000 milliseconds ( or 2 seconds )
  hot_flash('hello world', 2000 );

  // simple alert with close button
  hot_flash('goodbye world');</pre>
<p>It&#8217;s as simple as that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/mootools-alert-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP and Flex with Kerkness and Claire</title>
		<link>http://www.kerkness.ca/php-and-flex-with-kerkness-and-claire/</link>
		<comments>http://www.kerkness.ca/php-and-flex-with-kerkness-and-claire/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 05:24:38 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[claire]]></category>
		<category><![CDATA[kerkness]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=311</guid>
		<description><![CDATA[The following example shows a simple Flex application using Claire that communicates with a PHP server running Kerkness.
Click here to view the demo application
Click here to view the demo source
The demo application starts out by displaying a form which has 2 input fields.  When submitted the value of the form is submitted to the PHP [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows a simple Flex application using <a href="http://www.kerkness.ca/?page_id=97">Claire</a> that communicates with a PHP server running <a href="http://www.kerkness.ca/?page_id=95">Kerkness</a>.</p>
<p><a href="http://kerkness.ca/flexexamples/ClaireKerkness/ClaireKerkness.html">Click here to view the demo application</a></p>
<p><a href="http://kerkness.ca/flexexamples/ClaireKerkness/srcview/index.html">Click here to view the demo source</a></p>
<p>The demo application starts out by displaying a form which has 2 input fields.  When submitted the value of the form is submitted to the PHP service which validates the submission and returns a response.  If there are no errors the results are displayed.</p>
<h3>ClaireKerkness.mxml</h3>
<p>The main application MXML file contains the ViewController and a ViewStack with both our FormView and ResultView as children. When the view controller dispatches the mainViewChange event a handler function changes the displayed view.</p>
<h3>model/Views.as</h3>
<p>This is a very simple Actionscript class which defines a couple of static constants to use as the names for our two views.</p>
<h3>model/NameModel.as</h3>
<p>A simple Actionscript class which we use as a data model.  When a response is returned we update this model.</p>
<blockquote><p>NOTE: In this example our NameModel is a Singleton Class because we only want one instance.  This doesn&#8217;t have to be the case. You might want to create many instances of a data model if you expect many records of similar data.</p></blockquote>
<h3>views/FormView.mxml</h3>
<p>FormView is an MXML component that contains a couple of form elements and a ClaireService component which is used to send a HTTPService request to the Kerkness backend. If an error is returned the error message is displayed.  If a response is returned we update the NameModel and change the currentView to our ResultView.</p>
<h3>views/ResultView.mxml</h3>
<p>ResultView is a simple MXML component which displays content from the NameModel.</p>
<h3>kerk/module/demo/submitform.php</h3>
<p>This is the PHP file which accepts our form submission. Check out the kerkness tutorials for details on how the <a href="http://www.kerkness.ca/?page_id=95">kerkness</a> framework handles requests.</p>
<p>PHP Source Code</p>
<pre name="code" class="php">

if( ! $_POST['firstname'] || ! $_POST['lastname'] )
{
 	$kerk->throwError('Incomplete Submission...', true );
}

$fullName = $_POST['firstname']. ' ' .$_POST['lastname'];

$kerk->addContent('fullName', $fullName); 
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/php-and-flex-with-kerkness-and-claire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overview of Claire Components</title>
		<link>http://www.kerkness.ca/overview-of-claire-components/</link>
		<comments>http://www.kerkness.ca/overview-of-claire-components/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 04:00:18 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Components]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[claire]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=270</guid>
		<description><![CDATA[This is a partial list of components which can be found in the Claire library.

AlertTimer
Based on the main Alert controller for Flex.  AlertTimer will display a countdown and automatically close after the desired number of seconds.
AutoComplete
My take on creating an AutoComplete text input component.
ButtonPanel
Button Panel puts a button in your panel.
DateInput
A simple TextInput which allows [...]]]></description>
			<content:encoded><![CDATA[<p>This is a partial list of components which can be found in the Claire library.</p>
<ul>
<li><em><strong><a href="http://www.kerkness.ca/?p=14">AlertTimer</a></strong></em><br />
Based on the main Alert controller for Flex.  AlertTimer will display a countdown and automatically close after the desired number of seconds.</li>
<li><em><strong>AutoComplete</strong></em><br />
My take on creating an AutoComplete text input component.</li>
<li><em><strong>ButtonPanel</strong></em><br />
Button Panel puts a button in your panel.</li>
<li><em><strong>DateInput</strong></em><br />
A simple TextInput which allows the selction of a date using a calendar pop-up.  Perhaps a redundant class but I didn&#8217;t like the look/feel of the default Flex component which provides the same functionality.</li>
<li><em><strong>LockImage</strong></em><br />
A simple image component which displays a &#8216;Lock&#8217; icon in either a locked or an unlocked state.</li>
<li><em><strong>TagInput</strong></em><br />
Based on my own AutoComplete component, TagInput is good for editing a list of &#8216;tags&#8217;.</li>
<li><em><strong><a href="http://www.kerkness.ca/?p=50">Uploader</a></strong></em><br />
Yet another file upload component.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/overview-of-claire-components/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Claire, A Simple MVC for Adobe Air and Flex</title>
		<link>http://www.kerkness.ca/claire-a-simple-mvc-for-adobe-air-and-flex/</link>
		<comments>http://www.kerkness.ca/claire-a-simple-mvc-for-adobe-air-and-flex/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 22:43:00 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[claire]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/blog/?p=63</guid>
		<description><![CDATA[One thing that Claire can simplify for a developer is creating Flex or Adobe Air applications using MVC design patterns. Claire&#8217;s approach to MVC is based on a simplified Cairngorm architecture. It is not intended to be a replacement for the popular Cairngorm architecture or the many quality MVC options programmers have available to them, [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that Claire can simplify for a developer is creating Flex or Adobe Air applications using MVC design patterns. Claire&#8217;s approach to MVC is based on a <a href="http://clockobj.co.uk/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex/">simplified Cairngorm</a><a href="http://clockobj.co.uk/2007/10/17/simplified-cairngorm-easy-mvc-for-adobe-flex/"> architecture</a>. It is not intended to be a replacement for the popular <a href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm">Cairngorm architecture</a> or the many quality MVC options programmers have available to them, it is however a very flexible approach and allows the developer to use as little or as much of the library as they see fit.</p>
<h2>ViewModel and ViewController</h2>
<p>The main functionality behind the MVC approach in Claire is provided by the Singleton class <strong><em>claire.model.ViewModel</em></strong> and the component <em><strong>claire.controller.ViewController</strong></em>.  The ViewModel defines the</p>
<p>ViewController should be placed in your main application MXML file along with a ViewStack. The ViewController dispatches an event called &#8216;<em><strong>mainViewChange</strong></em>&#8216; every time the &#8216;<em><strong>currentView</strong></em>&#8216; property is updated in <strong><em>claire.model.ViewModel</em></strong>.</p>
<p>You&#8217;re main MXML file should contain a function which handles the event &#8216;<strong><em>mainViewChange</em></strong>&#8216; and changes the &#8216;<strong><em>selectedIndex</em></strong>&#8216; property of your ViewStack.</p>
<p>Because <strong><em>claire.model.ViewModel</em></strong> is a singleton class you can change the <strong><em>currentView</em></strong> at any time.</p>
<h2>Demo Application</h2>
<ul>
<li><a href="http://kerkness.ca/flexexamples/SimpleView/SimpleView.html">Click here to view a demo application using Claire MVC approach</a></li>
<li><a href="http://kerkness.ca/flexexamples/SimpleView/srcview/index.html">Click here to view source code for demo application</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/claire-a-simple-mvc-for-adobe-air-and-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating your first JSON service request</title>
		<link>http://www.kerkness.ca/creating-your-first-json-service-request/</link>
		<comments>http://www.kerkness.ca/creating-your-first-json-service-request/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 19:31:18 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[kerkness]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=240</guid>
		<description><![CDATA[
In this example we are going to create a web service which returns a JSON formatted string. This request could be called from almost any type of AJAX or Javascrpt HTTP Request which expects a JSON formatted response.
Test the example: http://kerkness.ca/kerkdemo/hello.world
Example 1
Create the directory kerk/modules/hello/
Inside the &#8216;hello&#8217; directory create the file &#8216;world.php&#8217; and add the [...]]]></description>
			<content:encoded><![CDATA[<div id="page-content">
<p>In this example we are going to create a web service which returns a JSON formatted string. This request could be called from almost any type of AJAX or Javascrpt HTTP Request which expects a JSON formatted response.</p>
<p>Test the example: <a onclick="window.open(this.href, '_blank'); return false;" href="http://kerkness.ca/kerkdemo/hello.world">http://kerkness.ca/kerkdemo/hello.world</a></p>
<h2 id="toc0"><span>Example 1</span></h2>
<p>Create the directory kerk/modules/hello/</p>
<p>Inside the &#8216;hello&#8217; directory create the file &#8216;world.php&#8217; and add the following to it.</p>
<div class="code">
<pre><code>&lt;?php
    $kerk-&gt;addContent('myvar', 'Hello World');
?&gt;</code></pre>
</div>
<p>Now you can make a request for this service by calling <a href="http://kerkness.ca/kerkdemo/hello.world">http://kerkness.ca/kerkdemo/hello.world</a> and see the following response</p>
<div class="code">
<pre><code>{"content":{"myvar":"Hello World"}}</code></pre>
</div>
<h2 id="toc1"><span>Next</span></h2>
<p><a href="http://www.kerkness.ca/?p=243">Creating your first HTML service request</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/creating-your-first-json-service-request/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a web page from multiple requests or content blocks</title>
		<link>http://www.kerkness.ca/creating-a-web-page-from-multiple-requests-or-content-blocks/</link>
		<comments>http://www.kerkness.ca/creating-a-web-page-from-multiple-requests-or-content-blocks/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 19:18:45 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[kerkness]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=248</guid>
		<description><![CDATA[In this example we are going to create a web page that uses a theme as well as several dynamic content blocks. The page theme will include a dynamic navigation menu and the main body of the page will include a random quote content block.
Test this example: http://kerkness.ca/kerkdemo/example.home
Example 4
If you haven&#8217;t done so already check [...]]]></description>
			<content:encoded><![CDATA[<p>In this example we are going to create a web page that uses a theme as well as several dynamic content blocks. The page theme will include a dynamic navigation menu and the main body of the page will include a random quote content block.</p>
<p>Test this example: <a onclick="window.open(this.href, '_blank'); return false;" href="http://kerkness.ca/kerkdemo/example.home">http://kerkness.ca/kerkdemo/example.home</a></p>
<h2 id="toc0"><span>Example 4</span></h2>
<p>If you haven&#8217;t done so already check out <a href="http://www.kerkness.ca/?p=240">Example 1</a>, <a href="http://www.kerkness.ca/?p=243">Example 2</a> and <a href="http://www.kerkness.ca/?p=248">Example 3</a>.</p>
<h2 id="toc1"><span>Create folders and files</span></h2>
<p>Create the following folders. <em>kerk/modules/example</em> and <em>kerk/templates/example</em></p>
<p>Inside the <em>kerk/modules/example</em> folder create the files &#8216;<em>home.php</em>&#8216;, &#8216;<em>quote.php</em>&#8216;, &#8216;<em>nav.php</em>&#8216; and &#8216;<em>theme.php</em>&#8216;. These will be the scripts that are executed to create the content for our page.</p>
<p>Inside the <em>kerk/templates/example</em> folder create a similar set of files. &#8216;<em>home.php</em>&#8216;, &#8216;<em>quote.php</em>&#8216;, &#8216;<em>nav.php</em>&#8216; and &#8216;<em>theme.php</em>&#8216;. These files will be the templates used to format the content from our scripts.</p>
<h3 id="toc2"><span>kerk/modules/example/home.php</span></h3>
<div class="code">
<pre><code>&lt;?php
  $kerk-&gt;setResponseFormat('HTML');
  $kerk-&gt;setTheme('example.theme');
  $kerk-&gt;addRequest('example.quote');
?&gt;</code></pre>
</div>
<h3 id="toc3"><span>kerk/modules/example/theme.php</span></h3>
<div class="code">
<pre><code>&lt;?php
   $kerk-&gt;addRequest('example.nav');
?&gt;</code></pre>
</div>
<h3 id="toc4"><span>kerk/modules/example/nav.php</span></h3>
<div class="code">
<pre><code>&lt;?php
    $links[] = array('url'=&gt;'http://www.google.ca', 'name'=&gt;'Google');
    $links[] = array('url'=&gt;'http://kerkness.blogspot.com', 'name'=&gt;'Blog');
    $links[] = array('url'=&gt;'http://kerkness.wikidot.com', 'name'=&gt;'Wiki');

    $kerk-&gt;addContent('links', $links);
?&gt;</code></pre>
</div>
<h3 id="toc5"><span>kerk/modules/example/quote.php</span></h3>
<div class="code">
<pre><code>&lt;?php
  $quotes = array(
        'You are your shadow and your shadow is you.',
        'I am a banana!',
        'I would love a banana!',
        'How much is that banana!',
        'My banana is yellow!',
        'habba banana!',
        'Looks like a banana!',
        'Smells like a banana!',
        'Tastes like a banana!',
        'I am not a banana');
  $quote = $quotes[array_rand($quotes)];
  $kerk-&gt;addContent( 'quote', $quote );
?&gt;</code></pre>
</div>
<h3 id="toc6"><span>kerk/templates/example/home.php</span></h3>
<div class="code">
<pre><code>&lt;div align="left"&gt;
   This is my home page and here is some non-dynamic content.
&lt;/div&gt;
&lt;div style="background-color:#CCCCCC"&gt;
   [include:public.example.quote]
&lt;/div&gt;</code></pre>
</div>
<h3 id="toc7"><span>kerk/templates/example/theme.php</span></h3>
<div class="code">
<pre><code>&lt;html&gt;
  &lt;body&gt;
     &lt;h1&gt;This is my web page&lt;/h1&gt;
     [include:public.example.nav]
     &lt;div bgcolor="blue"&gt;
    [include:main_request]
     &lt;/div&gt;
     &lt;h5&gt;This is my page footer&lt;/h5&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
<h3 id="toc8"><span>kerk/templates/example/nav.php</span></h3>
<div class="code">
<pre><code>&lt;div style="width: 530px; background-color:#EEEEEE;"&gt;
 Navigation
&lt;?php foreach( $links as $i=&gt;$link ) { ?&gt;
    &lt;a href="&lt;?php print $link['url'] ?&gt;"&gt;&lt;?php print $link['name'] ?&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;
&lt;?php } // end foreach $links ?&gt;
&lt;/div&gt;</code></pre>
</div>
<h3 id="toc9"><span>kerk/templates/example/quote.php</span></h3>
<div class="code">
<pre><code>&lt;b&gt;Random Quote&lt;/b&gt;&lt;br/&gt;
&lt;i&gt;&lt;?php print $quote ?&gt;&lt;/i&gt;</code></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/creating-a-web-page-from-multiple-requests-or-content-blocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an HTML request with a Theme</title>
		<link>http://www.kerkness.ca/creating-an-html-request-with-a-theme/</link>
		<comments>http://www.kerkness.ca/creating-an-html-request-with-a-theme/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 19:16:31 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[kerkness]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=246</guid>
		<description><![CDATA[
In this example we set an additional request to act as a theme. Using themes are useful when you want several web pages or requests to be displayed in a consistent look. A theme is only relevant when sending an HTML formatted response.
Test the example: http://kerkness.ca/kerkdemo/hello.galaxy
Example 3
Inside the folder kerk/modules/hello create a file called galaxy.php [...]]]></description>
			<content:encoded><![CDATA[<div id="page-content">
<p>In this example we set an additional request to act as a theme. Using themes are useful when you want several web pages or requests to be displayed in a consistent look. A theme is only relevant when sending an HTML formatted response.</p>
<p>Test the example: <a onclick="window.open(this.href, '_blank'); return false;" href="http://kerkness.ca/kerkdemo/hello.galaxy">http://kerkness.ca/kerkdemo/hello.galaxy</a></p>
<h2 id="toc0"><span>Example 3</span></h2>
<p>Inside the folder kerk/modules/hello create a file called galaxy.php and add the following to it. This file is exactly the same as the universe.php file created in the <a href="http://www.kerkness.ca/?p=243">first HTML example</a> except we have added a line which sets the theme for our request. (note: We can still use the tempalte hello.universe even tho our request is hello.galaxy)</p>
<div class="code">
<pre><code>&lt;?php

  // Tell kerkness that this request should return an HTML response
  $kerk-&gt;setResponseFormat('HTML');

  // Set the template for this request
  $kerk-&gt;setTemplate( 'hello.universe' );

  // Set the theme for this request
  $kerk-&gt;setTheme( 'hello.theme' );

  // Add some content to the request object
  $kerk-&gt;addContent('myVar', 'Hello Galaxy');

?&gt;</code></pre>
</div>
<p>Inside the directory kerk/modules/hello create the file &#8216;theme.php&#8217; and add the following</p>
<div class="code">
<pre><code>&lt;?php

 $kerk-&gt;setTemplate('hello.theme');
 $kerk-&gt;addContent('page_title', "This is my theme title");

?&gt;</code></pre>
</div>
<p>Inside the directory kerk/templates/hello create the file &#8216;theme.php&#8217; and add the following</p>
<div class="code">
<pre><code>&lt;html&gt;
 &lt;body&gt;
    &lt;h1&gt;&lt;?php print $page_title ?&gt;&lt;/h1&gt;
    &lt;!-- Place include tag where results from our main request will be placed --&gt;
    [include:main_request]
    &lt;h2&gt;This is a footer&lt;/h2&gt;
 &lt;/body&gt;
&lt;/html&gt;</code></pre>
</div>
<p>Now when you call <a href="http://kerkness.ca/kerkdemo/hello.galaxy">http://kerkness.ca/kerkdemo/hello.galaxy</a> the request hello.galaxy will now be displayed inside the hello.theme.</p>
<h2 id="toc1"><span>Next</span></h2>
<p><a href="http://www.kerkness.ca/?p=248">Creating a full dynamic web page with several content blocks</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/creating-an-html-request-with-a-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating your first HTML service request</title>
		<link>http://www.kerkness.ca/creating-your-first-html-service-request/</link>
		<comments>http://www.kerkness.ca/creating-your-first-html-service-request/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 19:14:19 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[kerkness]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=243</guid>
		<description><![CDATA[
This example shows a request which returns a HTML formatted response using an HTML/PHP template. This request could be called by when a partial or full web page is expected in response. It could be used to load an entire web page or be used as a content block in another web page.
Test the example: [...]]]></description>
			<content:encoded><![CDATA[<div id="page-content">
<p>This example shows a request which returns a HTML formatted response using an HTML/PHP template. This request could be called by when a partial or full web page is expected in response. It could be used to load an entire web page or be used as a content block in another web page.</p>
<p>Test the example: <a onclick="window.open(this.href, '_blank'); return false;" href="http://kerkness.ca/kerkdemo/hello.universe">http://kerkness.ca/kerkdemo/hello.universe</a></p>
<h2 id="toc0"><span>Example 2</span></h2>
<p>If you haven&#8217;t already create the directory kerk/modules/hello</p>
<p>Inside the &#8216;hello&#8217; directory create the file &#8216;universe.php&#8217; and add the following to it.</p>
<div class="code">
<pre><code>&lt;?php

 // Tell kerkness that this request should return an HTML response
  $kerk-&gt;setResponseFormat('HTML');

  // Set the template for this request
  $kerk-&gt;setTemplate( 'hello.universe' );

  // Add some content to the request object
  $kerk-&gt;addContent('myVar', 'Hello Universe');

?&gt;</code></pre>
</div>
<p>Create the director kerk/templates/hello</p>
<p>Inside the &#8216;kerk/templates/hello&#8217; directory create the file &#8216;universe.php&#8217; and add the following to it</p>
<div class="code">
<pre><code>&lt;b&gt;This is the template for hello.universe&lt;/b&gt;&lt;br/&gt;
&lt;?php print $myVar ?&gt;</code></pre>
</div>
<p>Now you can make a request for this service by calling <a href="http://kerkness.ca/kerkdemo/hello.universe">http://kerkness.ca/kerkdemo/hello.universe</a> and see the following response:</p>
<hr /><strong>This is the template for hello.universe</strong><br />
Hello Universe</p>
<hr />
<h2 id="toc1"><span>Next</span></h2>
<p><a href="http://www.kerkness.ca/?p=246">Your first HTML request with Theme</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/creating-your-first-html-service-request/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Kerkness</title>
		<link>http://www.kerkness.ca/installing-kerkness/</link>
		<comments>http://www.kerkness.ca/installing-kerkness/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 19:10:59 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[kerkness]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=238</guid>
		<description><![CDATA[Installing Kerkness ( overview )
Kerkness requires a web server running php5 with php-json enabled. It has been primarily test on Ubuntu servers running Apache2 but should be suitable for any server environment running php5.
If you plan on using clean request URLs you will need to have the Apache ReWrite module enabled for your apache server [...]]]></description>
			<content:encoded><![CDATA[<h2 id="toc0"><span>Installing Kerkness ( overview )</span></h2>
<p>Kerkness requires a web server running php5 with <a href="http://www.aurore.net/projects/php-json">php-json</a> enabled. It has been primarily test on Ubuntu servers running Apache2 but should be suitable for any server environment running php5.</p>
<p>If you plan on using clean request URLs you will need to have the Apache ReWrite module enabled for your apache server and requires the use of a .htaccess file.</p>
<p>Basic install steps:</p>
<ol>
<li><a href="http://www.kerkness.ca/?page_id=279">Download current version of kerkness</a></li>
<li>Copy the contents of the folders &#8216;kerk&#8217; and &#8216;www&#8217; to your web server where &#8216;www&#8217; is the root directory for your website or domain.</li>
<li>Modify the values in the config file &#8216;www/kc.php&#8217;;</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/installing-kerkness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
