title: Symfony2 - checking if file exists
body: <p>I have a loop in Twig template, which returns multiple values. Most important - an ID of my entry. When I didn't use any framework nor template engine, I used simply <code>file_exists()</code> within the loop. Now, I can't seem to find a way to do it in Twig.</p>
  
  <p>When I display user's avatar in header, I use <code>file_exists()</code> in controller, but I do it because I don't have a loop.</p>
  
  <p>I tried <code>defined</code> in Twig, but it doesn't help me. Any ideas?</p>