title: How to render a view inside of other twig + Modal Dialog Symfony2
body: <p>Today I wanna a show a <a href="http://bootboxjs.com/" rel="nofollow">modal dialog</a> with a form</p>
  
  <p>This is my code of main:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;button class="btn btn-primary btn-lg btn-new" data-toggle="modal" data-target="#agregarPunto"&gt;
            Nueva Ronda
  &lt;/button&gt;
  &lt;div  style="display: none;"  class="modal fade" id="agregarPunto" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"  aria-hidden="true"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                  &lt;h4 class="modal-title" id="myModalLabel"&gt;Agregar ronda&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                   {% embed "controlidMembersBundle:Members:newRonda.html.twig" %}
                   {% endembed %}
               &lt;/div&gt;
               &lt;div class="modal-footer"&gt;
                  &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Cancelar&lt;/button&gt;
                  &lt;button type="button" class="btn btn-primary"&gt;Crear ronda&lt;/button&gt;
               &lt;/div&gt;
           &lt;/div&gt;
       &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>This is the code of my view that I wanna embed</p>
  
  
  
  <pre><code>{% block nueva_ronda -%}
     &lt;h1&gt;Nueva ronda&lt;/h1&gt;
     {{ form(form) }}
     &lt;ul class="record_actions"&gt;&lt;/ul&gt;
  {% endblock %}
  </code></pre>
  
  <p>The trouble is when I click on the button, because I get the following error:</p>
  
  <pre class="lang-php prettyprint-override"><code>Variable "form" does not exist in   /var/www/html/controlid/src/controlid/Bundle/MembersBundle/Resources/views/Members/newRo nda.html.twig at line 5
  </code></pre>
  
  <p>This mistake is obviusly, because I don't know how to call the controller to render the form.</p>
  
  <p>This is the action on symfony  that should rendered the form</p>
  
  
  
  <pre><code>/*
   * @Route("/ronda/crear", name="members_ronda_new")
   * @Method("GET")
   * @Template()
   */
  public function newRondaAction()
  {
      $entity = new Ronda();
      $form   = $this-&gt;createRondaForm($entity);
  
      return array(
          'entity' =&gt; $entity,
          'form'   =&gt; $form-&gt;createView(),
      );
  }
  </code></pre>
  
  <p>How to embed code  inside of my <a href="http://bootboxjs.com/" rel="nofollow">modal-dialog</a> to render the form?</p>