<?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 on: OO PHP templating</title>
	<atom:link href="http://www.techfounder.net/2008/11/18/oo-php-templating/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techfounder.net/2008/11/18/oo-php-templating/</link>
	<description>Blog about web development and Internet entrepreneurship</description>
	<lastBuildDate>Wed, 03 Mar 2010 01:05:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sagi</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-841</link>
		<dc:creator>Sagi</dc:creator>
		<pubDate>Fri, 05 Feb 2010 10:07:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-841</guid>
		<description>Ok, the missing word for me was &quot;only&quot;.
I don&#039;t think it&#039;s a big deal, because there is no danger in overriding $file.
Also, sometimes it&#039;s useful when you have the template&#039;s name inside.

Thanks.</description>
		<content:encoded><![CDATA[<p>Ok, the missing word for me was &#8220;only&#8221;.<br />
I don&#8217;t think it&#8217;s a big deal, because there is no danger in overriding $file.<br />
Also, sometimes it&#8217;s useful when you have the template&#8217;s name inside.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eran Galperin</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-839</link>
		<dc:creator>Eran Galperin</dc:creator>
		<pubDate>Fri, 05 Feb 2010 00:54:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-839</guid>
		<description>I explained it in the post - it is included without parameters to keep the scope absolutely clean. Only $this is available from an outside scope inside the template, and you can declare any variable there without fear of override.</description>
		<content:encoded><![CDATA[<p>I explained it in the post &#8211; it is included without parameters to keep the scope absolutely clean. Only $this is available from an outside scope inside the template, and you can declare any variable there without fear of override.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sagi</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-837</link>
		<dc:creator>Sagi</dc:creator>
		<pubDate>Thu, 04 Feb 2010 23:21:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-837</guid>
		<description>Why you have chosen to implement _include without parameters?
If you declare $file and use it instead of func_get_arg(0),
would it change something?

Thanks,
Sagi.</description>
		<content:encoded><![CDATA[<p>Why you have chosen to implement _include without parameters?<br />
If you declare $file and use it instead of func_get_arg(0),<br />
would it change something?</p>
<p>Thanks,<br />
Sagi.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kai Sellgren</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-739</link>
		<dc:creator>Kai Sellgren</dc:creator>
		<pubDate>Fri, 06 Mar 2009 22:56:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-739</guid>
		<description>I prefer for easy templating languages, because many web designers, who write (X)HTML would not be afraid of learning PHP, although Smarty has a short learning curve. But still, it is a learning curve, and I would prefer for simple tagging system like [TITLE], etc. Of course, the template would be compiled, so no string replacements will ever occur.</description>
		<content:encoded><![CDATA[<p>I prefer for easy templating languages, because many web designers, who write (X)HTML would not be afraid of learning PHP, although Smarty has a short learning curve. But still, it is a learning curve, and I would prefer for simple tagging system like [TITLE], etc. Of course, the template would be compiled, so no string replacements will ever occur.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philips Tel</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-732</link>
		<dc:creator>Philips Tel</dc:creator>
		<pubDate>Fri, 30 Jan 2009 06:22:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-732</guid>
		<description>good job!!!</description>
		<content:encoded><![CDATA[<p>good job!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eran Galperin</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-728</link>
		<dc:creator>Eran Galperin</dc:creator>
		<pubDate>Sun, 04 Jan 2009 02:55:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-728</guid>
		<description>Hi Alex, nice to see you here :)
The pattern that solves the push versus pull decision is the two-step view - http://martinfowler.com/eaaCatalog/twoStepView.html

And you can see a PHP implementation of it in the Zend Framework - http://framework.zend.com/manual/en/zend.layout.html

Personally, I don&#039;t use this pattern often since I have the privilege of implementing both the domain model and the templates, so I can plan my model methods accordingly and use smart caching where needed.</description>
		<content:encoded><![CDATA[<p>Hi Alex, nice to see you here <img src='http://www.techfounder.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
The pattern that solves the push versus pull decision is the two-step view &#8211; <a href="http://martinfowler.com/eaaCatalog/twoStepView.html" rel="nofollow">http://martinfowler.com/eaaCatalog/twoStepView.html</a></p>
<p>And you can see a PHP implementation of it in the Zend Framework &#8211; <a href="http://framework.zend.com/manual/en/zend.layout.html" rel="nofollow">http://framework.zend.com/manual/en/zend.layout.html</a></p>
<p>Personally, I don&#8217;t use this pattern often since I have the privilege of implementing both the domain model and the templates, so I can plan my model methods accordingly and use smart caching where needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PCSpectra</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-727</link>
		<dc:creator>PCSpectra</dc:creator>
		<pubDate>Sun, 04 Jan 2009 02:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-727</guid>
		<description>Interesting article. ALthough doesn&#039;t Smarty also offer inclusion of files? 

Just incase you are curious, the author of ANTLR parser generator wrote an paper a while back in which he refers to templates (if memory serves me correctly) push versus pull.

I googled quickly and found it here: 

http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf

Perhaps worth a read?

Cheers,
Alex</description>
		<content:encoded><![CDATA[<p>Interesting article. ALthough doesn&#8217;t Smarty also offer inclusion of files? </p>
<p>Just incase you are curious, the author of ANTLR parser generator wrote an paper a while back in which he refers to templates (if memory serves me correctly) push versus pull.</p>
<p>I googled quickly and found it here: </p>
<p><a href="http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf" rel="nofollow">http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf</a></p>
<p>Perhaps worth a read?</p>
<p>Cheers,<br />
Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Tangey</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-715</link>
		<dc:creator>Greg Tangey</dc:creator>
		<pubDate>Tue, 09 Dec 2008 14:08:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-715</guid>
		<description>amen to most of Zyx&#039;s last paragraph!

We use HTML Template IT from PEAR.. while not perfect it gets the job done well.</description>
		<content:encoded><![CDATA[<p>amen to most of Zyx&#8217;s last paragraph!</p>
<p>We use HTML Template IT from PEAR.. while not perfect it gets the job done well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zyx</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-710</link>
		<dc:creator>Zyx</dc:creator>
		<pubDate>Mon, 24 Nov 2008 16:17:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-710</guid>
		<description>For me, using OOP for templates looks like taking a nuclear missle to kill a fly. In fact, it&#039;s hard to call your templates &quot;objective&quot; - they are normal PHP files with some loops and conditions, where the only occurence of OOP are &quot;-&gt;&quot; used to read the data assigned by the script. You can easily achieve the same effect with ordinary functions. Something that we may call &quot;objective templates&quot; can be observed in Zend Framework, where we use decorator pattern to decorate the form controls with some extra stuff.

Smarty is not a revolution. Practically it offers nothing but changed syntax to provide the same loops and conditions, like PHP, and moreover it limits us to this very subset of PHP language. However, please notice that imperative languages in general suffer from some disadvantages: the code is not portable and reusable, heavily depends on a single script and forces us to think on the implementation of various quite simple issues every time we want to use them.

There&#039;s a huge potential in designing a new template language and writing a compiler for it in PHP. All we need is a good idea for the language model. The compiler can hide some mess of PHP syntax, whole algorithm implementations (declarative programming - tell, **what** you want to see, not **how** it is supposed to work, like SQL does with the databases) and do things that pure PHP will never be able to achieve.</description>
		<content:encoded><![CDATA[<p>For me, using OOP for templates looks like taking a nuclear missle to kill a fly. In fact, it&#8217;s hard to call your templates &#8220;objective&#8221; &#8211; they are normal PHP files with some loops and conditions, where the only occurence of OOP are &#8220;-&gt;&#8221; used to read the data assigned by the script. You can easily achieve the same effect with ordinary functions. Something that we may call &#8220;objective templates&#8221; can be observed in Zend Framework, where we use decorator pattern to decorate the form controls with some extra stuff.</p>
<p>Smarty is not a revolution. Practically it offers nothing but changed syntax to provide the same loops and conditions, like PHP, and moreover it limits us to this very subset of PHP language. However, please notice that imperative languages in general suffer from some disadvantages: the code is not portable and reusable, heavily depends on a single script and forces us to think on the implementation of various quite simple issues every time we want to use them.</p>
<p>There&#8217;s a huge potential in designing a new template language and writing a compiler for it in PHP. All we need is a good idea for the language model. The compiler can hide some mess of PHP syntax, whole algorithm implementations (declarative programming &#8211; tell, **what** you want to see, not **how** it is supposed to work, like SQL does with the databases) and do things that pure PHP will never be able to achieve.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AntonioCS</title>
		<link>http://www.techfounder.net/2008/11/18/oo-php-templating/comment-page-1/#comment-708</link>
		<dc:creator>AntonioCS</dc:creator>
		<pubDate>Wed, 19 Nov 2008 20:43:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.techfounder.net/?p=135#comment-708</guid>
		<description>Ops!!! Misread sorry :)</description>
		<content:encoded><![CDATA[<p>Ops!!! Misread sorry <img src='http://www.techfounder.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
