[ via Eric Snowden ] Brian Lozier has a great Sitepoint article on PHP template engines.
His main point is that a template engine should dissociate presentation from logic, not keep PHP code out of HTML.
He gives us a compact, caching template class using those principles. His templates use PHP’s echo () and the alternate for-each syntax, so you don’t worry about learning a new language.
I don’t like the short-open tag syntax he uses, since I can’t treat the template files as XML with processing instructions, but the templates will work with <?php echo $foo; ?> instead of <?=$foo ?>.
Related posts: