资产.yml:
assetic:
assets:
base_js:
inputs:
- '%kernel.root_dir%/Resources/public/jquery-1.10.2.min.js'
- '%kernel.root_dir%/Resources/public/bootstrap3/js/bootstrap.min.js'
output: 'js/scripts.js'
base_css:
inputs:
- '%kernel.root_dir%/Resources/public/bootstrap3/css/bootstrap.min.css'
output: 'js/styles.css'
配置.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: assets.yml }
#...
assetic:
debug: %kernel.debug%
use_controller: false
bundles: [MyAdminBundle]
#java: /usr/bin/java
filters:
cssrewrite: ~
在模板中:
{% block javascripts %}
{% javascripts '@base_js' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
但是,作为输出,我得到js/80e3acc_part_1.js并且该文件仅包含 jquery 代码,缺少 boostrap。任何想法如何解决这一问题?