• 请不要在回答技术问题时复制粘贴 AI 生成的内容
assad
V2EX  ›  程序员

现在大家都习惯用哪个 PHP 模板引擎啊

  •  
  •   assad · Jun 28, 2016 · 7011 views
    This topic created in 3784 days ago, the information mentioned may be changed or developed.

    据说 Smarty 已经不行了, Twig 感觉还是很挫,哪个比较好呢?

    27 replies  •  2016-06-29 13:22:38 +08:00
    acoldfox
    acoldfox
    Jun 28, 2016
    1
    volt
    easychen
    easychen
    Jun 28, 2016
    2
    我用 PHP 的原生模板。话说 Twig 其实还算顺眼啊。
    Wangxf
    Wangxf
    Jun 28, 2016
    3
    laravel 不是推荐 blade 么
    assad
    assad
    OP
    Jun 28, 2016
    4
    @Wangxf 移植性感觉不好
    assad
    assad
    OP
    Jun 28, 2016
    5
    @easychen 每次改完文件,必须强行删除 cache 才生效,所以感觉不好使
    ConteMan
    ConteMan
    Jun 28, 2016
    6
    “据说 Smarty 已经不行了”,这个是因为啥?
    assad
    assad
    OP
    Jun 28, 2016
    7
    @Conte 觉得性能低
    strwei
    strwei
    Jun 28, 2016
    8
    PHP 的原生模板+1 ,性能极佳
    cxbig
    cxbig
    Jun 28, 2016
    9
    现在流行 PHP 做 API ,传 json ,模板渲染交给 React 、 AngularJS 、 VueJS 之类的前端框架。
    sfree2005
    sfree2005
    Jun 28, 2016 via iPhone
    10
    同意楼上。反正现在的不少 web app 都要有 mobile app , API 迟早要写。所以可以慢慢迁移到 angular react 之类。我目前是 Smarty 和 angular 混用,只是过渡方案。
    assad
    assad
    OP
    Jun 28, 2016
    11
    @strwei 呵呵。可是前后端配合起来不是很友好!
    assad
    assad
    OP
    Jun 28, 2016
    12
    @sfree2005 鄙人 JS 就是一坨屎,哎!
    shoaly
    shoaly
    Jun 28, 2016
    13
    性能永远不再 这个模板层上.... 选个喜欢的 或者框架自带的就可以了
    likezun
    likezun
    Jun 28, 2016
    14
    twig
    chaegumi
    chaegumi
    Jun 28, 2016
    15
    codeigniter 原生的
    mcfog
    mcfog
    Jun 28, 2016
    16
    php

    如果非要引用点什么的话,推荐看看 league/plates
    rwalle
    rwalle
    Jun 28, 2016
    17
    我觉得这种帖子以后是不是可以去 /go/monthly 了
    breeswish
    breeswish
    Jun 28, 2016
    18
    没遇到过比 twig 更好用的了
    volt 的 template inheritance 就是个摆设没啥用
    ------
    删 cache 是你没开 debug 模式吧
    Moker
    Moker
    Jun 28, 2016
    19
    blade 写得很爽啊 phpstorm 也有提示
    或者 vuejs 交给前端去做也行
    assad
    assad
    OP
    Jun 28, 2016
    20
    @breeswish 明白了,没好好看文档
    assad
    assad
    OP
    Jun 28, 2016
    21
    @Moker 基本上不喜欢用 IDE ,感觉臃肿的很啊
    phithon
    phithon
    Jun 28, 2016
    22
    因为常写 python 的缘故,必然是 twig
    ykjsw
    ykjsw
    Jun 28, 2016
    23
    用 discuz 那个,轻便高效,我的几个项目都是用那个 www.jser.com 下面的所有页面, sns.net 还有这个
    techmoe
    techmoe
    Jun 28, 2016 via Android
    24
    Smarty 王道
    dongyu
    dongyu
    Jun 29, 2016
    25
    twig , blade 都不错
    assad
    assad
    OP
    Jun 29, 2016
    26
    @ykjsw 呵呵,以前我也经常用
    hwsdien
    hwsdien
    Jun 29, 2016
    27
    以前用过 twig, 觉得还可以
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1620 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 10:17 · PVG 18:17 · LAX 02:17 · JFK 05:17
    ♥ Do have faith in what you're doing.