<?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>RichardHole.co.uk &#187; Misc</title>
	<atom:link href="http://richardhole.co.uk/category/misc/feed/" rel="self" type="application/rss+xml" />
	<link>http://richardhole.co.uk</link>
	<description>The Homepage of Richard Hole</description>
	<lastBuildDate>Sun, 07 Mar 2010 19:45:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Hello world! No, really!</title>
		<link>http://richardhole.co.uk/misc/hello-world/</link>
		<comments>http://richardhole.co.uk/misc/hello-world/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 15:56:12 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://richardhole.co.uk/?p=1</guid>
		<description><![CDATA[This is just a quick post to say hello. Click on the permalink to view the message]]></description>
			<content:encoded><![CDATA[<p>Hi. My name is, as you have probably guessed, Richard Hole and your on my site. Yay. Updates are on their way but I have to get the rest of the site up and running. So this is what I want to say:</p>
<pre>function HelloWorld(){
echo 'Hello World';
}

HelloWorld();</pre>
]]></content:encoded>
			<wfw:commentRss>http://richardhole.co.uk/misc/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An explanation of Smarty template engine</title>
		<link>http://richardhole.co.uk/misc/a-basic-explanation-of-smarty-template-engine/</link>
		<comments>http://richardhole.co.uk/misc/a-basic-explanation-of-smarty-template-engine/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 15:07:59 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://richardhole.co.uk/?p=55</guid>
		<description><![CDATA[Considering that there are so many web applications and software using the smarty template engine; and that one of those pieces of software is Flatpress (I used to use it), I thought it would be a good idea to write a bit about smarty and how it works.]]></description>
			<content:encoded><![CDATA[<p>Considering that there are so many web applications and software using the smarty template engine; and that one of those pieces of software is Flatpress, I thought it would be a good idea to write a bit about smarty.</p>
<h4>What is it?</h4>
<p>The clue is in the name; it’s a template engine. What this means is that smarty is used to display the output of processed data and <strong>does not</strong> do the processing itself; even thought Smarty is able to do a small amount of processing.</p>
<p>Smarty divides the structure of a web application cleanly into two phases; Processing and output. This is how the application would be divided.</p>
<pre>PHP SCRPIT  (PROCESSING) &gt; TPL FILE (THE DESIGN) &gt; OUTPUT HTML (WHAT THE BROWSER SEES)</pre>
<p><img title="More..." src="http://sneakatron.co.uk/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<h4>Why use it?</h4>
<p>There are various reasons why smarty should be used to handle the presentation of a site. Here are a few.</p>
<p>It’s clean &#8211; The combination of PHP and HTML can look very messy. Why would anyone want all those pieces of PHP code in with the presentation layer of your website, when all the processing can be done via PHP and then have the output displayed with a simple tag?</p>
<p>It has Add-ons – Add-ons are available to help speed up development. Examples of these are Pagination, Form Validation, Drop Down Menus, Calendar Date Pickers, etc.</p>
<p>It’s fast – Smarty has a huge set of features, but this does not impede the performance of the engine. Smarty has built in caching capabilities that can be used to make the presentation of the site load much faster. Though most of the time this is not needed.</p>
<p>For more features: <a href="http://www.smarty.net/rightforme.php">http://www.smarty.net/rightforme.php</a></p>
<h4>Examples</h4>
<p>Here is a simple example of how smarty can be used:</p>
<p>PHP</p>
<pre>include('Smarty.class.php');
// create object
$smarty = new Smarty;

// assign some content. This would typically come from
// a database or other source, but we'll use static
// values for the purpose of this example.
$smarty-&gt;assign('name', 'george smith');
$smarty-&gt;assign('address', '45th &amp; Harris');
// display it
$smarty-&gt;display('index.tpl');</pre>
<p>TPL File</p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;User Info&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
User Information:&lt;br /&gt;
Name: {$name}&lt;br /&gt;
Address: {$address}&lt;br /&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Output HTML</p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;User Info&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
User Information:&lt;br /&gt;
Name: george smith&lt;br /&gt;
Address: 45th &amp; Harris&lt;br /&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>View more examples: <a href="http://www.smarty.net/crashcourse.php">http://www.smarty.net/crashcourse.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://richardhole.co.uk/misc/a-basic-explanation-of-smarty-template-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
