Hacker News new | past | comments | ask | show | jobs | submit login

>> Twig (http://twig.sensiolabs.org/).

The syntax is very Django/Jinja alike. They took good inspiration.

Meanwhile, why the Wordpress team didn't switch to a template engine and orm after all those years is a true mystery to me.




Considering Wordpress isn't and probably will never be a true MVC application, I don't see the point of adding in a template parser like Twig and separating code. All it does is adds unnecessary overhead all at the cost of prettier code, there's no other advantage to be honest considering PHP itself is already somewhat a templating engine. If people want a CMS that separates code from the presentation layer, they probably shouldn't be using Wordpress and considering Drupal instead. I've used Drupal and Wordpress quite extensively and let me tell you, after building one site in Drupal you truly appreciate just how easy Wordpress makes it to get stuff done in half the time even if it is at the cost of prettier code (clients don't care about code cleanliness all they care about is results and Wordpress gets results).


Is it just me who doesn't see the point of using a templating engine with a language like PHP?

As long as you use the MVC paradigm or at-least sperate views from business and data store logic it seems like PHP works fine to do the templating its self.

Yes I can see the argument that non coders have to learn PHP, but is PHP really much harder to learn then the template language?

Also templating add's performance overhead.

What you essentially end up with is a "hypertext preprocessor preprocessor"


That's because twig was originally created by Armin - the creator of jinja. It was part of a (now abandoned) blogging engine called chyrp. Later, twig was salvaged by Fabien and incorporated into symfony.


Backwards compatibility with their existing ecosystem, really. There are a lot of people who make a lot of money building and supporting themes, and breaking all of that would be a massive change that could lose them a lot of community support.


Drupal 8 is talking about using Twig, which my guess is very likely. Twig is made by the same people that start Symfony 2, parts of which Drupal 8 is going to be using.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: