title: Symfony2 Theming form generated by embedded controller action
body: <p>I am generating the form in embedded controller action. And now i have faced the following problem. The Form Theming is not working in that case.</p>
  
  <p>So what i have:</p>
  
  <ol>
  <li><p>The tempalte "page.html.twig"</p>
  
  <pre><code>{% block content %}
  {% render 'MyBundle:Widget:index' %}
  {% endblock %}
  </code></pre></li>
  <li><p>The indexAction() creates the form and rendering another template "form.html.twig" which is normally renders a form using form_row, form_rest and so on.</p></li>
  </ol>
  
  <p>So, now i am trying to customize form theming, and here is my problem.
  When i put the code </p>
  
  <pre><code>{% form_theme form _self %}
  </code></pre>
  
  <p>in the page.html.twig, i got an error the the form variable does not exists. And its correct, the form var is created later in the embedded controller.
  But when i put the theming code in embedded template "form.html.twig", i got another error "Variable "compound" does not exist"</p>
  
  <pre><code>{% block form_label %}
  {% spaceless %}
      {% if not compound %}
          {% set label_attr = label_attr|merge({'for': id}) %}
      {% endif %}
      {% if required %}
          {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
      {% endif %}
      {% if label is empty %}
          {% set label = name|humanize %}
      {% endif %}
      &lt;label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %} {% if attr.tooltip is defined %}title="{{ attr.tooltip }}"{% endif %}&gt;{{ label|trans({}, translation_domain) }}{% if required %}&lt;span&gt;*&lt;/span&gt;{% endif %}&lt;/label&gt;
  {% endspaceless %}
  {% endblock form_label %}
  </code></pre>
  
  <p>This part of code was copied from this file <a href="https://github.com/symfony/symfony/blob/2.1/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig" rel="nofollow">https://github.com/symfony/symfony/blob/2.1/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig</a></p>
  
  <p>So tried someone to do something like this?</p>