setty
setty

Reputation: 215

Symfony 2 Assetic. Don't see single css or js file

When I add such lines in my layout.html.php:

<?php foreach ($view['assetic']->stylesheets(
    array('@AnglerBackendBundle/Resources/public/css/*')
    ) as $url
    ): ?>
    <link rel="stylesheet" href="<?= $view->escape($url) ?>" />
<?php endforeach ?>

Config:

# 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

I see 5 tags link with 5 resourses but according to Symfony 2 docs I should see only one file. What I did wrong

Upvotes: 1

Views: 1410

Answers (1)

adavea
adavea

Reputation: 1622

Just to put the answer in an actual answer:

You need to change this: $kernel = new AppKernel('prod', true);

To this: $kernel = new AppKernel('prod', false);

The second parameter is the debug parameter. Assetic will only write one file if debugging is off.

Upvotes: 4

Related Questions