I am using this to create a custom function 'file_exists'.
$volt->getCompiler()->addFunction('file_exists', function($file) {
return file_exists('https://localhost/balloon/' . $file);
});
When I try to call the function in an if statement, the compiled template is blank (if statement).
{% if file_exists("public/images/edited/" ~ picture.position ~ "/" ~ session.get('username') ~ "_" ~ picture.text|url_encode ~ "." ~ picture.extension) %}
{% endif %}