title: Twig - how to natively display RedBean relationships inside template?
body: <p>I'm trying to get symfony's <em>Twig</em> to play nicely with <em>RedBean</em>.</p>
  
  <p>I can display a top-level bean's data, but none of its relationships.</p>
  
  <p>Here's what I mean:</p>
  
  <p>In my controller, I'm calling Twig in a standard way (somewhat psuedo code):</p>
  
  <pre><code>// Controller
  $vars = array(
      'people' = R::find('person')
  );
  
  return $this-&gt;app['twig']-&gt;render('index.twig',$vars);
  </code></pre>
  
  <p>My beans are structured as follows:</p>
  
  <pre><code>PERSON
  -&gt;id
  -&gt;first_name
  -&gt;last_name
  -&gt;company &lt;-- (this represents a 'company' bean)
  
  COMPANY
  -&gt;id
  -&gt;name
  </code></pre>
  
  <p>Inside <em>index.twig</em>, I can easily output the person's name like this...</p>
  
  <pre><code>{% for person in people %}
      {{person.first_name}}
  {% endfor %}
  </code></pre>
  
  <p>... but what I WANT to be able to access is the associated company bean, like this...</p>
  
  <pre><code>{% for person in people %}
      **{{person.company.name}}**
  {% endfor %}
  </code></pre>
  
  <p>How do I do that from inside a twig template without requiring additional controller/model logic?</p>