title: Twig check if file exists
body: <p>Hello so I am using slim framework and twig, and here is my current code in php:</p>
  
  <pre><code>$filename = '/path/to/foo.txt';
  if (file_exists($filename)) {
      echo "The file $filename exists";
  } else {
      echo "The file $filename does not exist";
  }
  </code></pre>
  
  <p>Now I want to put the if statement in my template file. How can I use the <code>file_exists</code> function in my twig template so I can check whether a file exists?</p>