title: Displaying symfony object values in twig template
body: <p>Im new to Symfony / Twig and am having problems passing object values to my twig templates.</p>
  
  <p>Here is some of my controller code that shows the content of the object:</p>
  
  <pre><code>$prevArticles = $section-&gt;getArticles();      
  print_r($prevArticles);
  die()
  </code></pre>
  
  <p>Displays:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Imagine\NewsletterBundle\Entity\Article Object
          (
              [id:protected] =&gt; 
              [title:protected] =&gt; 
              [headline:protected] =&gt; 
              [link:protected] =&gt; 
              [image:protected] =&gt; 
              [excerpt:protected] =&gt; 
              [check:protected] =&gt; 
              [attachment:protected] =&gt; 
              [field1:protected] =&gt; 
              [field2:protected] =&gt; 
              [field3:protected] =&gt; 
              [magazines:protected] =&gt; 
              [top_logo_advert:protected] =&gt; /uploaded_images/cece0b1859ea2b1af95f1f274620ba77.jpg
              [top_logo_alt:protected] =&gt; Picture of blomange
              [top_logo_link:protected] =&gt; www.google.com
          )
  
  )
  </code></pre>
  
  <p>So then I pass my object to my twig template like so:</p>
  
  <pre><code>    return $this-&gt;render('ImagineNewsletterBundle:Section:'.$builder-&gt;getTemplate(), array('prevArticles' =&gt; $prevArticles));
  </code></pre>
  
  <p>Then in my twig template I want to display the value of 'top_logo_advert' but its not working:</p>
  
  <pre><code>{% for article in prevArticles %}
  
     {{ article.top_logo_advert }}
  
  {% endfor %}
  </code></pre>
  
  <p>I get the error message:</p>
  
  <pre><code>Method "top_logo_advert" for object "Imagine\NewsletterBundle\Entity\Article" does not exist in ImagineNewsletterBundle:Section:build_advert.html.twig at line 62
  </code></pre>