title: symfony2 render action array to more than 1 template
body: <p>I am new to Symfony (and PHP as well). I currently have a method indexAction in my Controller which renders an array of objects ($results) to the index view (index.html.twig template) - this part works.</p>
  
  <p>I would like to use the SAME array that I am rendering in index.html.twig in a different view page. Is it possible to render an array to multiple templates?</p>
  
  <p>I've tried adding a 2nd render statement, but it doesn't work (I get an error saying that the array being called in the 2nd template does not exist - thus only the 1st render statement is working). I've thought about copying and pasting the content of indexAction into get_stuffAction (both methods in the same controller), but I think this is probably not the best way to proceed (lots of redundant code).</p>
  
  <pre><code>return $this-&gt;render('TryBundle:Try:index.html.twig',  array('results'=&gt;$results));
  return $this-&gt;render('TryBundle:Try:get_stuff.html.twig',  array('results'=&gt;$results));
  </code></pre>
  
  <p>Just wondering if someone knows how to render an array to multiple views, or if I can somehow use the array created in indexAction function in the get_stuffAction function.</p>
  
  <p>Thank you kindly for your time!</p>