title: Extends parent blocks from embed template
body: <p>I would like to inject inside the styles and scripts blocks in my layout new values, but from the embed block.
  Of course it throws the error <code>Calling "parent" outside a block is forbidden.</code>.
  Is there any workaround ?</p>
  
  <p><strong>layout.html.twig:</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          {% block style %}
              &lt;link rel="stylesheet" href="foo.css"&gt;
          {% endblock %}
      &lt;/head&gt;
      &lt;body&gt;
  
          {% block content "" %}
  
          {% block scripts %}
              &lt;script src="foo.js"&gt;&lt;/script&gt;
          {% endblock %}
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>list.html.twig:</strong></p>
  
  <pre><code>{% extends 'layout.html.twig' %}
  
  {% block content %}
      {% embed datatable.html.twig %}
          {% block tbody %}
              &lt;tr&gt;
                  &lt;td&gt;my awesome table&lt;/td&gt;
              &lt;/tr&gt;
          {% endblock %}
      {% endembed %}
  {% endblock %}
  </code></pre>
  
  <p><strong>datatable.html.twig:</strong></p>
  
  <pre><code>&lt;table id="myDatatable"&gt;
      &lt;tbody&gt;
          {% block tbody "" %}
      &lt;/tbody&gt;
  &lt;/table&gt;
  
  {% block styles %}
      {{ parent() }}
      &lt;link rel="stylesheet" href="dataTables.css"&gt;
  {% endblock %}
  
  {% block scripts %}
      {{ parent() }}
      &lt;script src="dataTables.js"&gt;&lt;/script&gt;
  {% endblock %}
  </code></pre>
  
  <p>(And I cant/wont use the blocks <code>scripts</code> and <code>styles</code> inside the <code>list.html.twig</code>. They are part of the datatable template, it will not make any sens to define theme in the <code>list.html.twig</code>.).
  And sadly I cant use <code>use</code> because this function does not support dynamics properties, only strings.</p>
  
  <p><a href="http://twig.sensiolabs.org/doc/2.x/tags/use.html" rel="nofollow noreferrer">From the doc</a> :</p>
  
  <blockquote>
    <p>Because use statements are resolved independently of the context passed to the template, the template reference cannot be an expression.</p>
  </blockquote>