bigsmoke.us— In this opinion piece, I discuss why I think that pure PHP templates are always better than using a separate template language such as Smarty.
Nov 19, 2006View in Crawl 4
@zoom1928: I'm completely at a loss why and what kind of message you get. I do have an error message for Internet Explorer users, which serves mostly to protect them from the much more confusing error which stems from serving pure XHTML 1.1. Since MSIE can't handle my web pages anyway, I can just as well point visitors towards a better browser.
I'm not sure if you've already read the article, but there is one argument which I forgot to use in it. Using Smarty doesn't promote the creation of helper functions, meaning that you'll often end up with more complex structures in your templates than strictly necessary to save yourself from having to wrap a plug-in around each helper function.Also, if Smarty is so much cleaner, why do the CakePHP, Symfony, Biscuit and Code Igniter frameworks use pure PHP templates? (Not sure if I myself agree with this last argument here, since it would imply that Internet Explorer is a better browser due to its widespread acceptance ;-)Do you realize that using pure PHP templates doesn't forbid a clean separation of controllers and views? Or is your argument based on Smarty's simpler syntax? In that case, I can name a few template languages with cleaner syntax.Still, though, Smarty is a very well-written piece of software, in my opinion. I just so happen to believe that there is no need for it ;-)
@zoom1928: What exactly do you mean? When I open it in Firefox or Konquerer, I get to see the page just fine. It's when I let my browser identify itself as Internet Explorer, I get a polite page saying that the site doesn't work on Internet Explorer, and suggests a better browser, like Firefox. So if anything, he does not have a hatred for firefox, irrational or otherwise.Are you using a proxy perhaps, which caches the wrong page for you?Could you quote the message you get?
inolesNov 19, 2006
no digg, Smarty is much cleaner than php pure template
bigsmokeNov 19, 2006Submitter
@zoom1928: I'm completely at a loss why and what kind of message you get. I do have an error message for Internet Explorer users, which serves mostly to protect them from the much more confusing error which stems from serving pure XHTML 1.1. Since MSIE can't handle my web pages anyway, I can just as well point visitors towards a better browser.
bigsmokeNov 19, 2006Submitter
I'm not sure if you've already read the article, but there is one argument which I forgot to use in it. Using Smarty doesn't promote the creation of helper functions, meaning that you'll often end up with more complex structures in your templates than strictly necessary to save yourself from having to wrap a plug-in around each helper function.Also, if Smarty is so much cleaner, why do the CakePHP, Symfony, Biscuit and Code Igniter frameworks use pure PHP templates? (Not sure if I myself agree with this last argument here, since it would imply that Internet Explorer is a better browser due to its widespread acceptance ;-)Do you realize that using pure PHP templates doesn't forbid a clean separation of controllers and views? Or is your argument based on Smarty's simpler syntax? In that case, I can name a few template languages with cleaner syntax.Still, though, Smarty is a very well-written piece of software, in my opinion. I just so happen to believe that there is no need for it ;-)
halfgaarNov 20, 2006
@zoom1928: What exactly do you mean? When I open it in Firefox or Konquerer, I get to see the page just fine. It's when I let my browser identify itself as Internet Explorer, I get a polite page saying that the site doesn't work on Internet Explorer, and suggests a better browser, like Firefox. So if anything, he does not have a hatred for firefox, irrational or otherwise.Are you using a proxy perhaps, which caches the wrong page for you?Could you quote the message you get?
cluelessJan 24, 2007
sounds reasonable...
gerkirillDec 2, 2008
Heh.. I also think php is smart enough. Here is my small examples of using pure-php templating - <a class="user" href="http://gerr.info/templating/">http://gerr.info/templating/</a>