title: Include assets in Twig Extension with Symfony2
body: <p>I want to include asset with some script file in Twig extension. E.g. I want to declare twig function <code>{{ init_project() }}</code>, but when I writing in my twig function <code>'&lt;script type="text/javascript" src="{{ asset('bundles/mybundle/js/script.js') }}"&gt;&lt;/script&gt;'</code>, it dont work, it return 404 error in debug panel of browser. So how I can do this?</p>