I’m playing around with a PHP framework that uses Smarty Templating Engine to separate logic from its presentation, and I’m very impressed thus far.

Smarty seems to pull off elegant API, powerful features and oustanding performance - a rare triumvirate.

On top of that, it has a vibrant community and a ton of documentation scattered around the web. I’m liking this PHP thing more than I like to admit.

Check out how Smarty pulls off variable modifiers (one of my favorite features) with shell-like pipe syntax:

{* apply modifier to a variable *}
{$title|upper}
{* modifier with parameters *}
{$title|truncate:40:”…”}

{* apply modifier to a function parameter *}
{html_table loop=$myvar|upper}
{* with parameters *}
{html_table loop=$myvar|truncate:40:”…”}

{* apply modifier to literal string *}
{”foobar”|upper}

{* using date_format to format the current date *}
{$smarty.now|date_format:”%Y/%m/%d”}

{* apply modifier to a custom function *}
{mailto|upper address=”me@domain.dom”}