我正在为Symfony2使用kriswallsmith/assetic(symfony/AsseticBundle)包,我正在寻找一种使用assetic:dump只渲染部分文件的方法。
我在解释自己:我的应用程序作为管理管理的一些资产,以及其他用于前端的资产,我希望能够仅转储前端资产,这是可能的吗?
这个assetic:dump也总是为app_dev.php和app.php渲染这两个文件,有没有办法告诉他只渲染编译好的css/js?
谢谢
发布于 2015-01-25 22:38:33
在拥有assetic配置的app/config/config.yml中,您可以添加以下内容:
assetic:
#####
assets:
this_is_the_name_of_the_dumpfile:
inputs:
- %kernel.root_dir%/../web/css/style.css
- another/path/to/another/file
- ######
filters:
- yui_js
- other_defined_filter如果您将assetic配置为将文件转储到/web/assetic/,请在您的小枝文件中添加转储文件的路径:{{ asset('assetic/this_is_the_name_of_the_dumpfile.css') }}
https://stackoverflow.com/questions/28136821
复制相似问题