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.

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

报告相同问题?

悬赏问题

  • ¥15 网络科学导论,网络控制
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)