anassghz
anassghz

Reputation: 21

assetic symfony2: html content inside css files

I'm trying to import css file inside twig file using assetic.

{% stylesheets 'bundles/sfeuser/css/bootstrap.css' filter='cssrewrite' %}
    <link rel="stylesheet" href="{{ asset_url }}"  type="text/css" />
{% endstylesheets %}

when I load the page. it was only HTML without style and when I checked the css file. I found out that it contains HTML content of the page loaded.

Upvotes: 1

Views: 82

Answers (1)

anassghz
anassghz

Reputation: 21

In the security.yml file I forgot to remove a firewall with authentification that was applied on the whole application.

That's why when the browser tries to access the CSS file it gets redirected to the login page. Therefore the HTML content of the login page was found in the CSS file.

Upvotes: 1

Related Questions