0

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.

edigu
  • 9,878
  • 5
  • 57
  • 80
bkilinc
  • 989
  • 2
  • 13
  • 28

1 Answers1

2

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.

macghriogair
  • 1,431
  • 10
  • 8
  • thanks. overtime my code is refactored to use more updated libraries. like moving from ADODB to ZendDB. All Pear packages to its Zend equivalents (Cache, Mail, Auth, Log) some to php extension (XML (un)serializer to simpleXML). I felt I was punished to start early, but these were all right moves. I couldn't decide on Smarty, as it is stable and updated. Less updated, may be because it is stable enough. – bkilinc Mar 22 '16 at 12:45