<?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: How I PHP: The Output Handler</title>
	<atom:link href="http://www.jasny.net/articles/how-i-php-the-output-handler/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jasny.net/articles/how-i-php-the-output-handler/</link>
	<description>It&#039;s all about me, mysql and Einstein.</description>
	<lastBuildDate>Thu, 09 Sep 2010 15:08:00 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Stuart</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-8439</link>
		<dc:creator>Stuart</dc:creator>
		<pubDate>Wed, 02 Jan 2008 22:49:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-8439</guid>
		<description>Sorry - the example I tried to give wasn&#039;t clear because most of it got stripped out!  I&#039;ve put up what it should have said (as far as I can remember!) at http://www.google.co.uk/notebook/public/09355657237885062984/BDSCAQgoQ2vDz5PMi?hl=en

As I said before, the function display_page can then be made more complicated by adding more parameters, e.g. telling it how to display the menu.

My point is that this is simpler -- easier to write and debug -- than using the in-built template functions combined with regex, and so I don&#039;t see the advantage of using the latter approach. I don&#039;t fear regular expressions for genuine string manipulation but they seem a messy solution for this type of thing...?</description>
		<content:encoded><![CDATA[<p>Sorry &#8211; the example I tried to give wasn&#8217;t clear because most of it got stripped out!  I&#8217;ve put up what it should have said (as far as I can remember!) at <a href="http://www.google.co.uk/notebook/public/09355657237885062984/BDSCAQgoQ2vDz5PMi?hl=en" rel="nofollow">http://www.google.co.uk/notebook/public/09355657237885062984/BDSCAQgoQ2vDz5PMi?hl=en</a></p>
<p>As I said before, the function display_page can then be made more complicated by adding more parameters, e.g. telling it how to display the menu.</p>
<p>My point is that this is simpler &#8212; easier to write and debug &#8212; than using the in-built template functions combined with regex, and so I don&#8217;t see the advantage of using the latter approach. I don&#8217;t fear regular expressions for genuine string manipulation but they seem a messy solution for this type of thing&#8230;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaloyan K. Tsvetkov</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-8039</link>
		<dc:creator>Kaloyan K. Tsvetkov</dc:creator>
		<pubDate>Sat, 22 Dec 2007 08:05:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-8039</guid>
		<description>I am sorry for the repeated comment, but the first one seems to be `butchered` because of the quotes I used in it.

Another thing that I forgot: very often you need to inject values or do other changes to the header and footer. I do not see how we can do this with the example you presented above. Can you show another example highlighting how to modify the header and  the footer ?</description>
		<content:encoded><![CDATA[<p>I am sorry for the repeated comment, but the first one seems to be `butchered` because of the quotes I used in it.</p>
<p>Another thing that I forgot: very often you need to inject values or do other changes to the header and footer. I do not see how we can do this with the example you presented above. Can you show another example highlighting how to modify the header and  the footer ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaloyan K. Tsvetkov</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-8038</link>
		<dc:creator>Kaloyan K. Tsvetkov</dc:creator>
		<pubDate>Sat, 22 Dec 2007 08:00:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-8038</guid>
		<description>Have you benchmarked the performance of this approach against the other `usual` ways to handle this type of functionality ?</description>
		<content:encoded><![CDATA[<p>Have you benchmarked the performance of this approach against the other `usual` ways to handle this type of functionality ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arnold Daniels</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-7397</link>
		<dc:creator>Arnold Daniels</dc:creator>
		<pubDate>Sat, 08 Dec 2007 14:08:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-7397</guid>
		<description>Stuart,

I must say that I don&#039;t think your example is very clear. What is $content? What does display_page.php do?

Do you build up the output as string instead of echo&#039;ing it and than put it into a function? If so, I really don&#039;t like that approach, because you loose the whole templating feature of PHP.

You can use PHP the template when use the output buffer and than simply include the template PHP file, because echo&#039;ing stuff won&#039;t work and even ob_start, ob_get_contents won&#039;t work correctly. That&#039;s why I use regulair expressions. And I can just say: Don&#039;t fear regexs, but learn to love them.</description>
		<content:encoded><![CDATA[<p>Stuart,</p>
<p>I must say that I don&#8217;t think your example is very clear. What is $content? What does display_page.php do?</p>
<p>Do you build up the output as string instead of echo&#8217;ing it and than put it into a function? If so, I really don&#8217;t like that approach, because you loose the whole templating feature of PHP.</p>
<p>You can use PHP the template when use the output buffer and than simply include the template PHP file, because echo&#8217;ing stuff won&#8217;t work and even ob_start, ob_get_contents won&#8217;t work correctly. That&#8217;s why I use regulair expressions. And I can just say: Don&#8217;t fear regexs, but learn to love them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-7382</link>
		<dc:creator>Stuart</dc:creator>
		<pubDate>Sat, 08 Dec 2007 01:27:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-7382</guid>
		<description>This is interesting and useful because I hadn&#039;t even realised the output buffering functions existed!  However I don&#039;t really see that it&#039;s any better than having something like this, which is simpler...

display_page.php (incorporating the template html):
&lt;code&gt;
etc.
etc.
&lt;/code&gt;

then index.php:
&lt;code&gt;
etc. etc.
HTML;
&lt;?
display_page($content); 
?&gt;
&lt;/code&gt; 

This way it&#039;s also very easy to add extra parameters to the display_page function, for instance telling it how menus should appear.  No messing round with regular expressions.  I think I&#039;ll be sticking with this way for the time being!</description>
		<content:encoded><![CDATA[<p>This is interesting and useful because I hadn&#8217;t even realised the output buffering functions existed!  However I don&#8217;t really see that it&#8217;s any better than having something like this, which is simpler&#8230;</p>
<p>display_page.php (incorporating the template html):<br />
<code><br />
etc.<br />
etc.<br />
</code></p>
<p>then index.php:<br />
<code><br />
etc. etc.<br />
HTML;<br />
< ?<br />
display_page($content);<br />
?><br />
</code> </p>
<p>This way it&#8217;s also very easy to add extra parameters to the display_page function, for instance telling it how menus should appear.  No messing round with regular expressions.  I think I&#8217;ll be sticking with this way for the time being!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cms review</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-6896</link>
		<dc:creator>cms review</dc:creator>
		<pubDate>Wed, 28 Nov 2007 08:28:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-6896</guid>
		<description>Looks great. Now I have to check it ;)</description>
		<content:encoded><![CDATA[<p>Looks great. Now I have to check it <img src='http://www.jasny.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Arnold</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-6490</link>
		<dc:creator>David Arnold</dc:creator>
		<pubDate>Tue, 20 Nov 2007 16:43:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-6490</guid>
		<description>Looking forward to it, always looking for ways to clean up and better process my code and markup!

-d</description>
		<content:encoded><![CDATA[<p>Looking forward to it, always looking for ways to clean up and better process my code and markup!</p>
<p>-d</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arnold Daniels</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-6487</link>
		<dc:creator>Arnold Daniels</dc:creator>
		<pubDate>Tue, 20 Nov 2007 15:22:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-6487</guid>
		<description>I&#039;ll get back on that in a new post, David.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll get back on that in a new post, David.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Arnold</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-6430</link>
		<dc:creator>David Arnold</dc:creator>
		<pubDate>Mon, 19 Nov 2007 16:39:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-6430</guid>
		<description>This seems to work pretty well and clean, however I am a little confused on how you would expand this.

For instance:

In your index file you might want to independently control part of the header, the menu, and of course the content so your template file would need three separate calls and then your callback would need to be able to sort out those calls in your index file.  Does that make sense?

How would handle this functionality?

Thanks, David</description>
		<content:encoded><![CDATA[<p>This seems to work pretty well and clean, however I am a little confused on how you would expand this.</p>
<p>For instance:</p>
<p>In your index file you might want to independently control part of the header, the menu, and of course the content so your template file would need three separate calls and then your callback would need to be able to sort out those calls in your index file.  Does that make sense?</p>
<p>How would handle this functionality?</p>
<p>Thanks, David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.jasny.net/articles/how-i-php-the-output-handler/comment-page-1/#comment-6070</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Wed, 14 Nov 2007 14:02:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.adaniels.nl/?p=59#comment-6070</guid>
		<description>hey, thanks for sharing this, I&#039;ve already used something like that a few times. But I keep wondering - what about the performance?</description>
		<content:encoded><![CDATA[<p>hey, thanks for sharing this, I&#8217;ve already used something like that a few times. But I keep wondering &#8211; what about the performance?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
