title: Symfony2 Append javascript flles from a form type template
body: <p>I am creating an image cropper as new form type in Symfony2 using the jQuery plugin imgAreaSelect (<a href="http://odyniec.net/projects/imgareaselect/" rel="nofollow">website</a>). In my form type template (imagecropper_widget.html.twig) I load jQuery and the plugins library.</p>
  
  <p>As jQuery is loaded as well in my base.html.twig, the functions in the plugin library don't work anymore. Firebug throws an "is not a function" error.
  If I remove in my base.html.twig the jQuery then it works well but of course that is not a solution.</p>
  
  <p>It would be great if there would be a way to append the javascript files I need in that moment to the javascripts block. I tried to override the javascripts block from my theme but Symfony throws an error because I don't use or extend from another template. </p>
  
  <p>So is there a legit way to append javascript files to a block that exists in the base.html.twig page?</p>
  
  <p>Javascript block in base.html.twig:</p>
  
  <pre><code>{% block javascripts %}
      {% javascripts '@jquery_js' '@bootstrap_js' filter='?yui_js' combine=true %}
          &lt;script src="{{ asset_url }}"&gt;&lt;/script&gt;
      {% endjavascripts %}
  {% endblock %}
  </code></pre>
  
  <p>imagecropper_widget.html.twig</p>
  
  <pre><code>{% block imagecropper_widget %}
     {% spaceless %}
      &lt;h2&gt;Select the area&lt;/h2&gt;
      &lt;img src="http://localhost/project/web/test.jpg" id="imgc" style="width:100%" /&gt;
  
      {% block javascripts %}
          {% javascripts
          '@jquery_js'
          'bundles/imanagecmsfield/js/jquery.imgareaselect.js'
          'bundles/imanagecmsfield/js/process.js'
          filter="?yui_js"
          %}
          &lt;script src="{{ asset_url }}"&gt;&lt;/script&gt;
          {% endjavascripts %}
  
      {% endblock %}
  
    {% endspaceless %}
  {% endblock %}
  </code></pre>
  
  <p>Thank you for your help!</p>