title: Rendering a Form in a Twig Template with Symfony2
body: <p>I have a base Twig template that has a search bar form in it at the top of the page in a Twig block.  I have another block later on named "content" that my children pages fill out.  Currently, my base template looks like this:</p>
  
  <pre><code>{% block admin_bar %}
      &lt;div id="search"&gt;
          &lt;form action="{{ path('search') }}" method="post" {{ form_enctype(search_form) }}&gt;
              {{ form_widget(search_form.term) }}
              {{ form_widget(search_form.type) }}
              {{ form_widget(search_form.pool) }}
              {{ form_widget(search_form._token) }}
              &lt;input type="submit" value="Search" /&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  {% endblock %}
  
  {% block content %}
  {% endblock %}
  </code></pre>
  
  <p>However, when trying to render a child template I need to pass in the <code>search_form</code> variable along with it.  Is there anyway (short of writing out the HTML tags myself) I can avoid having to create this <code>search_form</code> variable and pass it in everytime I want to render a child view?  I'm using Twig in conjunction with Symfony2.</p>
  
  <p>Thanks!</p>