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.

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

报告相同问题?

悬赏问题

  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥15 键盘指令混乱情况下的启动盘系统重装