title: How can I pass variable from parent template to child template in Twig?
body: <p>I'm working with Symfony and Twig and I can't find solution for the next problem:
  in my parent template (<strong>index.html.twig</strong>) I have such code:</p>
  
  <pre><code>&lt;noscript&gt;
      {% block noscript %}
      &lt;div class="alert alert-warning"&gt;
          &lt;strong&gt;{% block notice %}{{ notice_js_disabled }}{% endblock %}&amp;nbsp;&lt;/strong&gt;
          {% block message %}{{ js_disabled }}{% endblock %}
      &lt;/div&gt;
      {% endblock %}
  &lt;/noscript&gt;
  </code></pre>
  
  <p>I have child template (<strong>category.html.twig</strong>) which extends <strong>index.html.twig</strong> template.</p>
  
  <p>Can I pass value of <code>{{ notice_js_disabled }}</code> var from index template to category template?<br>
  <code>notice_js_disabled</code> is returned from my Symfony <strong>indexAction</strong> controller.</p>
  
  <p><strong>UPD:</strong>
  The solution for my problem I founded, next:
  I have made base templae, called main.html.twig, where I'm rendering element from the controller:</p>
  
  <pre><code>{% block header %}
     {{ render(controller('StoreBundle:Header:index')) }}
  {% endblock %}
  </code></pre>
  
  <p>Then, on my index.html.twig file, I made next things:</p>
  
  <pre><code>{% extends 'Store/tpl/main.html.twig' %}
  {% block title %}{{ title }}{% endblock %}
  {% block content %}
      &lt;p class="currentPage" hidden&gt;home&lt;/p&gt;
      {{ parent() }}
  {% endblock %}
  </code></pre>
  
  <p>I'm not sure is it correct solution, but it's work:)</p>