dtgv52982 2016-03-03 07:31
浏览 75
已采纳

为什么Smarty模板引擎看起来不受支持?

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.

  • 写回答

1条回答 默认 最新

  • dongyin4202 2016-03-15 10:14
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 Ubuntu20.04中PVN3D复现过程交叉编译问题
  • ¥15 模拟电路求复阻抗和传递函数,请各位拍照写一下解答过程
  • ¥60 不懂得怎么运行下载来的代码
  • ¥15 CST导出3D模型图为什么和软件显示不一样?
  • ¥15 加热反应炉PLC控制系统设计(相关搜索:梯形图)
  • ¥15 python 用Dorc包报错,我的写法和网上教的是一样的但是它显示无效参数,是什么问题
  • ¥15 经过滑动平均后的一维信号还原用什么结构好呢?
  • ¥15 指定IP电脑的访问设置
  • ¥30 matlab ode45 未发现警告,但是运行出错
  • ¥15 为什么devc++编译项目会失败啊