title: How to send javascripts to the bottom? (in symfony 2)
body: <p>I want to create views that can by themselves print some html code, and at the same time, send javascript code to the bottom, without extending the layout</p>
  
  <p>The idea is that I have a layout, then the specific view for the current url extends that layout, and inside that view, I include other views, which have the power of adding code to other blocks that are out of scope (because they don't inherit from the layout or the view that inherits from it). Is that possible?</p>
  
  <p>Suppose this is a part of my layout:</p>
  
  <pre><code>{# ::layout.html.twig #}
  .
  .
  {% block javascripts %}
  {% endblock %}
  &lt;/body&gt;
  .
  .
  </code></pre>
  
  <p>and this is my view:</p>
  
  <pre><code>{# Company:Bundle:about.html.twig #}
  {% extends '::layout.html.twig' %}
  .
  .
  {% include 'Company:buttons:google_button.html.twig' %}
  .
  .
  </code></pre>
  
  <p>And this is the view I want to include, for example, a google +1 button:</p>
  
  <pre><code>{# Company:buttons:google_button.html.twig #}
  &lt;gb&gt;&lt;/gb&gt; {# or whatever #}
  
  {# somehow send '&lt;script&gt;blabla&lt;/script&gt;' to the 'javascripts' block #}
  </code></pre>
  
  <p>Is it possible to do something like this with twig and symfony2?</p>