title: Symfony2 include and access to the variables
body: <p>I dont have access to variables when try to include other file. 
  I try to add with keyword in include but dont work, all time i get message:</p>
  
  <blockquote>
    <p>Variable "entity" does not exist in
    ISLabBundlesBlogBundle:Post:last_post.html.twig at line 6</p>
  </blockquote>
  
  <p>First i have indexAction() where i list all published blog post.</p>
  
  <pre><code>public function indexAction()
  {
      $posts = $this-&gt;getDoctrine()-&gt;getRepository('ISLabBundlesBlogBundle:Post')-&gt;getAllPublishedPosts();
  
      return $this-&gt;render('ISLabBundlesBlogBundle:Page:index.html.twig', array(
          'posts' =&gt; $posts
      ));
  }
  </code></pre>
  
  <p>And have method where list only last posts</p>
  
  <pre><code>public function lastPostAction($count = 1)
  {
      $entity = $this-&gt;getDoctrine()-&gt;getRepository('ISLabBundlesBlogBundle:Post')-&gt;getLastPosts($count);
  
      return $this-&gt;render('ISLabBundlesBlogBundle:Post:last_post.html.twig', array(
          'entity' =&gt; $entity
      ));
  }
  </code></pre>
  
  <p>Problem is in this file in block sidebar. I try to include other file where i fetch only 1 last post.</p>
  
  <pre><code>{% extends 'ISLabBundlesBlogBundle::layout.html.twig' %}
  
  {% block body %}
      {# Fetch all post#}
      {% if posts %}
          {% for post in posts %}
              &lt;article class="blog"&gt;
                  &lt;div class="date"&gt;&lt;time datetime="{{ post.created|date('c') }}"&gt;{{ post.created|date('l, F j, Y') }}&lt;/time&gt;&lt;/div&gt;
                  &lt;header&gt;&lt;h2&gt; {{ post.title }} &lt;/h2&gt;&lt;/header&gt;
                  &lt;p&gt; {{ post.body }} &lt;/p&gt;
              &lt;/article&gt;
          {% endfor %}
      {% endif %}
  {% endblock %}
  
  {% block sidebar %}
      {% include 'ISLabBundlesBlogBundle:Post:last_post.html.twig'%}
  {% endblock %}
  </code></pre>
  
  <p>And here is file what i try to include:</p>
  
  <pre><code>&lt;h2&gt;Last Posts&lt;/h2&gt;
  
  &lt;div class="blog"&gt;
      &lt;ul&gt;
          {% for item in entity %}
              &lt;li&gt;&lt;a href=""&gt;{{item.title}}&lt;/a&gt;&lt;/li&gt;
          {% endfor %}
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What i do wrong? And how to slove this?</p>