<?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>PHP Software Developing &#187; smarty</title>
	<atom:link href="http://www.phpdeveloping.co.za/tag/smarty/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phpdeveloping.co.za</link>
	<description>for the love of PHP Development</description>
	<lastBuildDate>Tue, 29 Sep 2009 15:38:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Smarty quick and dirty</title>
		<link>http://www.phpdeveloping.co.za/templates/smarty-quick-and-dirty.html</link>
		<comments>http://www.phpdeveloping.co.za/templates/smarty-quick-and-dirty.html#comments</comments>
		<pubDate>Wed, 12 Aug 2009 19:44:56 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Templates]]></category>
		<category><![CDATA[smarty]]></category>

		<guid isPermaLink="false">http://www.phpdeveloping.co.za/?p=125</guid>
		<description><![CDATA[Smarty is an excellent template system used for PHP.  It&#8217;s definitely the best and most versatile one I&#8217;ve seen.
Let&#8217;s say you have an index.tpl (the default template file extension in Smarty) with the following in it:

&#60;html&#62;
&#60;head&#62;
&#60;title&#62;Information&#60;/title&#62;
&#60;/head&#62;
&#60;body&#62;
Number 1: {$num1}&#60;br&#62;
Number 2: {$num2}&#60;br&#62;
&#60;/body&#62;
&#60;/html&#62;

Now, to actually use the template you would have code like the following:

$smarty = new [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.smarty.net/">Smarty</a> is an excellent template system used for PHP.  It&#8217;s definitely the best and most versatile one I&#8217;ve seen.</p>
<p>Let&#8217;s say you have an index.tpl (the default template file extension in Smarty) with the following in it:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Information&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
Number 1: {$num1}&lt;br&gt;
Number 2: {$num2}&lt;br&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>Now, to actually use the template you would have code like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$smarty</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Smarty<span style="color: #339933;">;</span>
<span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'num1'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'111'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'num2'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'222'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$smarty</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'index.tpl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As simple as that!</p>
<p>The output would be:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Information&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
Number 1: 111&lt;br&gt;
Number 2: 222&lt;br&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>That is just a simple example, and there are a lot more advanced things you can do with it.  Check out the <a href="http://www.smarty.net/crashcourse.php">Smarty Crash Course</a> for some ideas.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpdeveloping.co.za/templates/smarty-quick-and-dirty.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
