title: symfony2.1: count doctrine collection in twig template
body: <p>I have a doctrine entity that has a collection of entities (<em>children</em>). 
  Now i want to count the entities and print out the count.
  Something like this:</p>
  
  <pre><code>&lt;div class="item"&gt;
   &lt;h1&gt;{{ object.name }}&lt;/h1&gt;
   &lt;div class="childrenCount"&gt;children {% count (object.children) %}&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I found some examples which didn't work (<a href="https://stackoverflow.com/questions/9598577/count-relations-inside-loop-in-twig"><em>like using a "count" filter</a> which resulted in a "filter not found" error</em>).</p>