当我在 layout.html.php 中添加这样的行时:
<?php foreach ($view['assetic']->stylesheets(
array('@AnglerBackendBundle/Resources/public/css/*')
) as $url
): ?>
<link rel="stylesheet" href="<?= $view->escape($url) ?>" />
<?php endforeach ?>
配置:
# Assetic Configuration
assetic:
debug: %kernel.debug%
use_controller: false
# java: /usr/bin/java
filters:
cssrewrite: ~
# closure:
# jar: %kernel.root_dir%/java/compiler.jar
yui_css:
jar: %kernel.root_dir%/java/yuicompressor.jar
yui_js:
jar: %kernel.root_dir%/java/yuicompressor.jar
我看到 5 个标签链接到 5 个资源,但根据 Symfony 2 文档,我应该只看到一个文件。我做错了什么