doukong9316 2016-01-25 16:03
浏览 40
已采纳

Symfony:加快前端开发人员的开发环境

I'm trying to create a development enviroment for the frontend developers. As long as they don't change any php code I thought it might be a good idea do this, if possible:

  1. Create a new entry point all app_frontend.php i.e., disabling the debug
  2. Create a config_frontend.yml file and cache php files generation but disable twig cache as well as js and css

Is there any way to do this? I'm not sure if it's possible

  • 写回答

1条回答 默认 最新

  • dongyong3223 2016-01-25 16:15
    关注

    You can create as many environments as you want. After all, environments are just sets of different configuration, nothing more.

    This means that if you want to create a frontend environment, you have to do just some things:

    • Create some sort of front controller that constructs AppKernel using new AppKernel('frontend', false);
    • As AppKernel::registerContainerConfiguration() in the Symfony Standard Edition uses the environment to determine the config file to load, you have to create app/config/config_frontend.yml as well (or change the logic in the AppKernel method)
    • Inside this config file, make sure you import the settings that are in common. This often means importing app/config/config.yml. Besides that, you can configure things how you like it. E.g.

      # app/config/config_frontend.yml
      imports:
          - { resource: config.yml }
      
      twig:
          cache: false
      

    You can read more about this topic in the Symfony docs.

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

报告相同问题?

悬赏问题

  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解