Q
Q
Quber2014-09-03 13:28:10
symfony
Quber, 2014-09-03 13:28:10

Why does Symfony 2 not properly generate image paths in stylesheet?

Actually a subject.
I write in the style file:

.img {
    background-image: url('../../images/group/test.jpg');
}

When the page loads, the css is compiled into a new file. All paths have been changed to:
.img {
    background-image: url('../../Resources/assets/images/group/test.jpg');
}

Of course, the pictures will not open along the new generated path, as it is prohibited by the security policy. How can Symfony generate correct paths?
PS I read the manual , but did not find anything like that.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-09-03
Protko @Fesor

unfortunately cssrewrite is a very capricious thing . I have personally ditched assetic in favor of gulp+bower. I advise you to read the ISUS about cssrewrite and the threads on SO.

S
Sergey Senkevich, 2014-09-03
@ssenkevich

symfony.com/doc/current/cookbook/assetic/asset_man...
UPD:
i.e. the error is most likely in the inclusion of css files - there you should use not '@MySuperBundle/Resources/css/*', but 'bundles/my_super/css/*'.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question