V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
assad
V2EX  ›  程序员

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

  •  
  •   assad · 2016 年 6 月 28 日 · 6266 次点击
    这是一个创建于 3491 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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