Reputation: 2927
I want to simply include stylesheets with assetic in my template. I want to keep all css files in the bundle public dir. Not in any app/ dir from another dir tree.
My webroot to the bundle CSS tree: [webroot]/src/Myvendor/MyBundle/Resources/public/css/
So i took this example
{# base.html.twig #}
{% stylesheets 'bundles/app/css/*' filter='cssrewrite' %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
Naturally this did not work with the example path on me, so i tried to insert my path. I dont want to make use of @MyvendorMyBundle/Resources/public/js/* due to the fact of the cssrewrite problems. But making use of this path, the css is going to be taken.
So i tried every relative constellation of my css path. And no one worked..
I really googled and found only examples that did not work for me, and they seems that they were all in the /app/Resources/foo... but i dont want this, it must stay in the bundle.
What im doing wrong? Thanks in advice.
Upvotes: 1
Views: 2194
Reputation: 41934
Well, if you don't move your stylesheet anywhere it is in src/Easylearn/QuerybuildBundle/Resources/public/css/
. However, when using relative paths, they are relative to the web/
directory. So do ../src/Easylearn/QuerybuildBundle/Resources/public/css/
.
I'm not sure actually why you don't set-up a symlink from all public/
directories in bundles to web/bundles
(by running app/console assets:install --symlink
).
Upvotes: 4