title: Can the method redirectToRoute() have arguments like render()?
body: <p>I need to access an entity in twig from symfony2.
  Inside the controler, I can do something as:</p>
  
  <pre><code>return $this-&gt;render('frontendBundle::carrodecompras.html.twig', array(
          'entity' =&gt; $entity
  ));
  </code></pre>
  
  <p>And then in twig I can access the entity properties with <code>entity.name</code> and such.</p>
  
  <p>I need to accomplish the same thing but with the function <code>redirectToRoute()</code></p>
  
  <pre><code>return $this-&gt;redirectToRoute('frontend_carrodecompras', array(
          'entity' =&gt; $entity,
  ));
  </code></pre>
  
  <p>But it doesn't seem to work. </p>
  
  <p>I'm getting the following error:</p>
  
  <p>Variable "entity" does not exist in frontendBundle::carrodecompras.html.twig at line 32</p>
  
  <p>EDIT: I'm using Symfony 2.7</p>
  
  <p>The variable $entity exists (it's actually called $cortina in the app I was using $entity for simplification), just before the redirectToRoute function I did this to test it</p>
  
  <pre><code>echo "&lt;pre&gt;";
  var_dump($cortina);
  echo "&lt;/pre&gt;";
  
  return $this-&gt;redirectToRoute('frontend_carrodecompras', array(
                  'cortina' =&gt; $cortina,
                  ));
  </code></pre>
  
  <p>And the result is this:</p>
  
  <pre><code>object(dexter\backendBundle\Entity\cortina)#373 (16) {
    ["id":"dexter\backendBundle\Entity\cortina":private]=&gt;
    int(3)
    ...
  </code></pre>
  
  <p>This is the Twig code:</p>
  
  <pre><code>&lt;tr&gt;
      {% set imagentela = "img/telas/" ~ cortina.codInterno ~ ".jpg" %}
      &lt;td&gt;&lt;img src="{{ asset(imagentela | lower ) }}" alt="" width="25" height="25"&gt;
      &lt;/td&gt;
      &lt;td&gt;{{ cortina.nombre }}&lt;/td&gt;
      &lt;td&gt;{{ "$" ~ cortina.precio|number_format('0',',','.') }}&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>