title: Symfony assets relative to bundle
body: <p>EDIT | <a href="http://symfony.com/doc/current/assetic/asset_management.html#assetic-cssrewrite" rel="nofollow noreferrer">http://symfony.com/doc/current/assetic/asset_management.html#assetic-cssrewrite</a></p>
  
  <p>So does this mean I <em>absolutely</em> have to upload the CSS assets into "web" myself? Is there not a way to use assetic:dump to copy them from the bundle first?</p>
  
  <p>I have an application which is divided multiple smaller application via bundles.</p>
  
  <p>One bundle in particular is an attempt to integrate a legacy app into symfony to  run the same platform as a few other apps.</p>
  
  <p>This LegacyBundle has JS and CSS assets which I do not want manually uploaded into "web" - I was under the impression that using assetic allowed me to have the CLI tools compress and re-locate the assets into the web directory.</p>
  
  <p>This seems to be the case using @LegacyBundle prefix on the asset paths:</p>
  
  <pre><code>{% block javascripts %}
      {% javascripts 
          '@LegacyBundle/Resources/legacy/common/extjs/ext-all.js' 
      %}
      &lt;script src="{{ asset_url }}"&gt;&lt;/script&gt;
      {% endjavascripts %}
  {% endblock %}
  </code></pre>
  
  <p>Problem is - I need this same functionality with CSS files and apparently there is an issue using @ shortcut with CSS files and assetic:</p>
  
  <p><a href="http://symfony.com/doc/current/assetic/asset_management.html" rel="nofollow noreferrer">http://symfony.com/doc/current/assetic/asset_management.html</a></p>
  
  <blockquote>
    <p>Notice that in the original example that included JavaScript files, you referred to the files using a path like @AppBundle/Resources/public/file.js, but that in this example, you referred to the CSS files using their actual, publicly-accessible path: bundles/app/css. You can use either, except that there is a known issue that causes the cssrewrite filter to fail when using the @AppBundle syntax for CSS stylesheets.</p>
  </blockquote>
  
  <p>So I am trying to avoid using @LegacyBundle syntax for both JS and CSS - however I still wish to reference their paths in twig using the path relative to the bundle - where they go after that is of no concern to me.</p>
  
  <p>What am I missing? Is what I am trying to do possible?</p>
  
  <p>I tried moving ext-alljs.js into the bundle "Resources" root directory and then inside twig template I call the assets via</p>
  
  <pre><code>{% block javascripts %}
      {% javascripts 
          'Resources/ext-all.js' 
      %}
      &lt;script src="{{ asset_url }}"&gt;&lt;/script&gt;
      {% endjavascripts %}
  {% endblock %}
  </code></pre>
  
  <p>Unfortunately this doesn't work - whereas the previous example does. I am hoping I just have the path incorrect or something?</p>