<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Tatarynowicz's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Wed, 03 Sep 2008 18:34:12 GMT</pubDate>
    <description>DZone Snippets: Tatarynowicz's Code Snippets</description>
    <item>
      <title>Simplest possible PHP templating engine</title>
      <link>http://snippets.dzone.com/posts/show/3052</link>
      <description>// This code takes a template name and an array of variables&lt;br /&gt;// and parses them with a file&lt;br /&gt;// &lt;br /&gt;// Example:&lt;br /&gt;//   print template('hello', array('who'=&gt;'world'));&lt;br /&gt;//&lt;br /&gt;// Template (/templates/hello.html)&lt;br /&gt;//   Hello &lt;?=$who?&gt;!&lt;br /&gt;// &lt;br /&gt;// Outputs:&lt;br /&gt;//   Hello world!&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;define('DIR_TEMPLATES', dirname(__FILE__).'/templates');&lt;br /&gt;&lt;br /&gt;function template($__name__, $__data__=array()) {&lt;br /&gt;	extract($__data__);&lt;br /&gt;	ob_start();&lt;br /&gt;	require(DIR_TEMPLATES.'/'.$__name__.'.html');&lt;br /&gt;	return ob_get_clean();&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 28 Nov 2006 18:55:29 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3052</guid>
      <author>tatarynowicz (Michal Tatarynowicz)</author>
    </item>
  </channel>
</rss>
