<?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>Voidnothings &#187; templating engine</title>
	<atom:link href="http://www.voidnothings.com/tag/templating-engine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.voidnothings.com</link>
	<description>From pixel to markup.</description>
	<lastBuildDate>Sat, 31 Dec 2011 18:35:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Facebook introduces XHP</title>
		<link>http://www.voidnothings.com/2010/02/facebook-introduces-xhp/</link>
		<comments>http://www.voidnothings.com/2010/02/facebook-introduces-xhp/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 04:19:20 +0000</pubDate>
		<dc:creator>Lance</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[frontend development]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[templating engine]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[xhp]]></category>

		<guid isPermaLink="false">http://www.voidnothings.com/?p=232</guid>
		<description><![CDATA[Facebook again pushes the boundaries of PHP by introducing yet another tool,  just one week after announcing HipHop. This time, they introduce a new way of writing php code- XHP, the one they used on the Facebook Lite front-end. XHP does this by making PHP understand XML document fragments, similar to what E4X does for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.voidnothings.com/wp-content/uploads/2010/02/fbengineering1.jpg"><img class="alignnone size-full wp-image-239" title="fbengineering" src="http://www.voidnothings.com/wp-content/uploads/2010/02/fbengineering1.jpg" alt="" width="500" height="345" /></a></p>
<p>Facebook again pushes the boundaries of PHP by introducing yet another tool,  just one week after announcing HipHop. This time, they introduce a new way of writing php code- XHP, the one they used on the <a href="http://lite.facebook.com/" target="_blank">Facebook Lite</a> front-end.</p>
<blockquote><p>XHP does this by making PHP understand XML document fragments, similar to what <a title="http://en.wikipedia.org/wiki/ECMAScript_for_XML" href="http://www.facebook.com/note_redirect.php?note_id=294003943919&amp;h=eeab84845e9a1a0f8b96c2192ff008c0&amp;url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FECMAScript_for_XML" target="_blank">E4X</a> does for ECMAScript (JavaScript). While PHP is typically used to write front-end code, by itself it isn&#8217;t a very good language for generating HTML (as evidenced by the popularity of templating engines like <a title="http://www.smarty.net/" href="http://www.facebook.com/note_redirect.php?note_id=294003943919&amp;h=35161cce4c1736d4181c9d56455ecca4&amp;url=http%3A%2F%2Fwww.smarty.net%2F" target="_blank">Smarty</a>). XHP is something between a programmatic UI library and a full templating system&#8230;</p>
<p>&#8230;One last feature of XHP, which has been invaluable to us at Facebook, is that you can define your own elements which can condense a complex component into a simple XHP tag. XHP has a rich collection of declarations which let you define new elements, configure their expected attributes, as well as describe their <a title="http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.3.3.1" href="http://www.facebook.com/note_redirect.php?note_id=294003943919&amp;h=18317e7536525dd8a7581d7e475d39a8&amp;url=http%3A%2F%2Fwww.w3.org%2FTR%2Fhtml4%2Fintro%2Fsgmltut.html%23h-3.3.3.1" target="_blank">content model</a>. These features turn XHP into a powerful templating engine which is capable of simplifying complicated pages into easy to read high-level markup, but it&#8217;s up to you to create your own elements from the primitives that XHP defines&#8230;</p></blockquote>
<p>A thumbs up for Facebook, constraint really drives innovation.</p>
<p>You can read more about the <a href="http://www.facebook.com/notes/facebook-engineering/xhp-a-new-way-to-write-php/294003943919">official announcement here</a>, the <a href="http://wiki.github.com/facebook/xhp/" target="_blank">documentation</a>. Also, here&#8217;s a quick link to their open source repos on <a href="http://github.com/facebook" target="_blank">GitHub</a></p>
<p><strong>Update</strong>: Rasmus Lerdurf, the creator of PHP posted a quick note on <a href="http://toys.lerdorf.com/archives/54-A-quick-look-at-XHP.html" target="_blank">using XHP</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.voidnothings.com/2010/02/facebook-introduces-xhp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

