Search code examples
phptwigsmartyeclipse-pdtmezzio

Why Smarty templating engine looks like unsupported?


I am using smarty template engine for years, and I may use it in further projects. But I am not sure if this is a good idea. While Smarty is an active project updated regularly, it looks like an inactive, unsupported project.

  1. smarty.net Website looks like outdated.
  2. Eclipse PDT does not support Smarty, while it supports Twig. (however netbeans support it)
  3. Zend Expressive does not support Smarty, while it supports Twig, Plates etc.

It looks like, it is unsupported by PHP community. Is it sensible to refactor our code to use Twig ? Or should we continue with Smarty? For future projects also.


Solution

  • This seems to be difficult to answer as the question is somewhat opinion-based, and also there are similar posts already (e.g. regarding performance)

    Indeed, the Smarty website might look like back when they started in 2002, but I would not judge by that. There is still activity at their GitHub repo, although with lot less contributors than, say for Twig, which has a huge support around the Symfony community.

    Smarty is a mature engine in a stable state. Although less modern and less supported by the widely used frameworks (Symfony, Laravel, Zend) which is why I would not recommend it for starting a new project. But there might be cases where it still has it's place: Smarty is the only major template engine that I know still supports PHP 5.2. Recently, I had to refactor a legacy project that's still stuck with PHP 5.2 (I know, it is insane not to upgrade!), and I found Smarty very useful and fast to adapt for that.

    If you already have it implemented in your project, and don't see any necessity to change it besides just for self-purpose, why not keep it, it's stable. However, if you are refactoring anyway, for some other reason, or starting a new project, than go for Twig, Blade, Volt etc. But that's an opinion.