tag:blogger.com,1999:blog-12753102.post6298883401633918264..comments2024-03-28T15:41:37.170-04:00Comments on Ben's Journal: The PHP Template Pattern -- PHP As Its Own Templating LanguageBen Simonhttp://www.blogger.com/profile/09833753747177544979noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-12753102.post-59348283859212652642012-08-15T08:44:09.988-04:002012-08-15T08:44:09.988-04:00Thank you. This solves all my template problems.Thank you. This solves all my template problems.Gustavhttps://www.blogger.com/profile/04476514561343266458noreply@blogger.comtag:blogger.com,1999:blog-12753102.post-922684375507017032010-06-04T14:16:15.105-04:002010-06-04T14:16:15.105-04:00Jon -
The point isn't that Smarty or other te...Jon -<br /><br />The point isn't that Smarty or other templating systems are missing those features -- it's just that core PHP already offers them.<br /><br />Why add layers of complexity to your code, so you can reference a variable like:<br /><br />{foo}<br />instead of<br /><br /><br />Especially, when by giving up a little syntax, you gain an entire language - instead of sub-language built on top of your core language.Ben Simonhttps://www.blogger.com/profile/09833753747177544979noreply@blogger.comtag:blogger.com,1999:blog-12753102.post-2481763071693797032010-06-04T11:55:49.167-04:002010-06-04T11:55:49.167-04:00It sounds like you're just using a bad templat...It sounds like you're just using a bad templating system. Something like Template-Toolkit (perl, http://search.cpan.org/~abw/Template-Toolkit-2.22/).<br /><br />It has variables (substitution and assignment), loops, conditionals, blocks (essentially subroutines), flow control, macros, the ability to bind arbitrary code/plugins into the namespace from the Perl side, and, if you enable it, drop back into Perl.<br /><br />I can't imagine being happy with a templating missing most of those.Anonymousnoreply@blogger.com