How to make Symfony2 to load CSS, JS files directly and not via PHP?

前端 未结 5 973
无人及你
无人及你 2021-02-04 04:55

OLD QUESTION, SEE BELOW FOR THE UPDATED VERSION

My development environment is not the fastest. I takes roughly 500ms per PHP request. It\'s starting to

5条回答
  •  深忆病人
    2021-02-04 05:46

    From the documentation

    Modify the dev config to avoid using the controller.

    # app/config/config_dev.yml
    assetic:
        use_controller: false
    

    Remove the route in routing_dev.yml to avoid side effect

    # app/config/routing_dev.yml
    _assetic:
        resource: .
        type:     assetic
    

    Automatically dump your css/less files every time you have a modification.

    php app/console assetic:dump --watch
    

提交回复
热议问题