symfony2 - assetic:dump - 选择性转储方式

时间:2015-01-25 13:15:51

标签: symfony assetic

我正在为Symfony2使用kriswallsmith / assetic(symfony / AsseticBundle)软件包,我一直在寻找一种使用assetic:dump来渲染部分文件的方法。

我解释自己: 我的应用程序作为管理员管理的一些资产,而其他用于前端,我希望能够只转储前端资产,是否可能?

这个资产:dump也一直在渲染app_dev.php和app.php这两个文件是否有办法告诉他只渲染已编译的css / js?

由于

1 个答案:

答案 0 :(得分:1)

在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 /,请在twig文件中添加转储文件的路径:{{ asset('assetic/this_is_the_name_of_the_dumpfile.css') }}

相关问题