How to get assets img url in Symfony controller : <p>I'm using assets in Symfony 2.7.10 and I want to generate an image url in the controller. </p>

<p>In the symfony config.yml file I have added the following setting:</p>

<pre><code>framework:
    assets:
          version: '311nk2'
          version_format: '%%s?v=%%s'
          base_path: /bundles/myBundleName
</code></pre>

<p>In twig the generating of an url works ok, so with the following twig code:</p>

<pre><code>{{ asset('images/logo.png') }}
</code></pre>

<p>It generates:</p>

<pre><code>/bundles/myBundleName/images/logo.png?v=311nk2
</code></pre>

<p>Now I want to generate the same url in a controller, how is this possible?</p>
