<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for CodeAngel.org</title>
	<atom:link href="http://codeangel.org/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://codeangel.org</link>
	<description>Faith in Knowledge</description>
	<lastBuildDate>Mon, 01 Feb 2010 15:41:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Simple PHP Template Engine by Tomas Arribas</title>
		<link>http://codeangel.org/articles/simple-php-template-engine.html/comment-page-1#comment-272</link>
		<dc:creator>Tomas Arribas</dc:creator>
		<pubDate>Mon, 01 Feb 2010 15:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://codeangel.org/?p=14#comment-272</guid>
		<description>There is a small problem with your Template class when using arrays. 

Try this:

[code]
$view-&gt;a = array(&#039;foo&#039;);
var_dump($view-&gt;a); //foo is there, all fine

$view-&gt;a[] = &#039;bar&#039;;
var_dump($view-&gt;a); //bar is not there!
[/code]

To solve this, you need to return the __get by reference, like this:

[code]
public function &amp;__get($name){
  if (isset($this-&gt;vars[$name])) return $this-&gt;vars[$name]; 
  else return null;
}	
[/code]

It&#039;s also advisable to overload isset and unset

[code]
public function __isset($name) {        
  return isset($this-&gt;vars[$name]);
}

public function __unset($name) {
  unset($this-&gt;vars[$name]);
}
[/code]

Cheers!</description>
		<content:encoded><![CDATA[<p>There is a small problem with your Template class when using arrays. </p>
<p>Try this:</p>
<p>[code]<br />
$view-&gt;a = array('foo');<br />
var_dump($view-&gt;a); //foo is there, all fine</p>
<p>$view-&gt;a[] = 'bar';<br />
var_dump($view-&gt;a); //bar is not there!<br />
[/code]</p>
<p>To solve this, you need to return the __get by reference, like this:</p>
<p>[code]<br />
public function &amp;__get($name){<br />
  if (isset($this-&gt;vars[$name])) return $this-&gt;vars[$name];<br />
  else return null;<br />
}<br />
[/code]</p>
<p>It&#8217;s also advisable to overload isset and unset</p>
<p>[code]<br />
public function __isset($name) {<br />
  return isset($this-&gt;vars[$name]);<br />
}</p>
<p>public function __unset($name) {<br />
  unset($this-&gt;vars[$name]);<br />
}<br />
[/code]</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple PHP Template Engine by Chad Emrys Minick</title>
		<link>http://codeangel.org/articles/simple-php-template-engine.html/comment-page-1#comment-158</link>
		<dc:creator>Chad Emrys Minick</dc:creator>
		<pubDate>Sun, 13 Dec 2009 18:47:04 +0000</pubDate>
		<guid isPermaLink="false">http://codeangel.org/?p=14#comment-158</guid>
		<description>&lt;a href=&quot;#comment-155&quot; rel=&quot;nofollow&quot;&gt;@Frank Munch&lt;/a&gt; 
I don&#039;t think it&#039;s easier to learn than PHP at all. There is no evidence towards that.  And I think I covered the less dangerous part in the article.</description>
		<content:encoded><![CDATA[<p><a href="#comment-155" rel="nofollow">@Frank Munch</a><br />
I don&#8217;t think it&#8217;s easier to learn than PHP at all. There is no evidence towards that.  And I think I covered the less dangerous part in the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple PHP Template Engine by Frank Munch</title>
		<link>http://codeangel.org/articles/simple-php-template-engine.html/comment-page-1#comment-155</link>
		<dc:creator>Frank Munch</dc:creator>
		<pubDate>Sat, 12 Dec 2009 07:49:46 +0000</pubDate>
		<guid isPermaLink="false">http://codeangel.org/?p=14#comment-155</guid>
		<description>You don&#039;t mention the most important problem with Smarty - that some syntax is very clumsy, it is not object-oriented, and parametrization is difficult.
But the value of it is that it is easier to learn than PHP, and definitely less dangerous.</description>
		<content:encoded><![CDATA[<p>You don&#8217;t mention the most important problem with Smarty &#8211; that some syntax is very clumsy, it is not object-oriented, and parametrization is difficult.<br />
But the value of it is that it is easier to learn than PHP, and definitely less dangerous.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple PHP Template Engine by Chad Emrys Minick</title>
		<link>http://codeangel.org/articles/simple-php-template-engine.html/comment-page-1#comment-82</link>
		<dc:creator>Chad Emrys Minick</dc:creator>
		<pubDate>Tue, 27 Oct 2009 23:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://codeangel.org/?p=14#comment-82</guid>
		<description>I officially license this code with WTFPL:
http://en.wikipedia.org/wiki/WTFPL</description>
		<content:encoded><![CDATA[<p>I officially license this code with WTFPL:<br />
<a href="http://en.wikipedia.org/wiki/WTFPL" rel="nofollow">http://en.wikipedia.org/wiki/WTFPL</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple PHP Template Engine by Daniel Campbell</title>
		<link>http://codeangel.org/articles/simple-php-template-engine.html/comment-page-1#comment-81</link>
		<dc:creator>Daniel Campbell</dc:creator>
		<pubDate>Tue, 27 Oct 2009 23:40:08 +0000</pubDate>
		<guid isPermaLink="false">http://codeangel.org/?p=14#comment-81</guid>
		<description>This example gave me the necessary foundation to understand the concept behind template engines. It&#039;s very simple and easy to approach. I plan on using something similar to it in my backend&#039;s next version. Are there any stipulations on using this code?</description>
		<content:encoded><![CDATA[<p>This example gave me the necessary foundation to understand the concept behind template engines. It&#8217;s very simple and easy to approach. I plan on using something similar to it in my backend&#8217;s next version. Are there any stipulations on using this code?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
