How do we check for the existence of the file?<!-- INCLUDEPHP somefile.php -->
something like
Looking in the tutorials but can't find the right syntax.<!-- if EXISTS somefile.php --><!-- INCLUDEPHP somefile.php --> <!-- ENDIF --->
How do we check for the existence of the file?<!-- INCLUDEPHP somefile.php -->
Looking in the tutorials but can't find the right syntax.<!-- if EXISTS somefile.php --><!-- INCLUDEPHP somefile.php --> <!-- ENDIF --->
INCLUDEPHP
?Code: Select all
{% include '@vendor_extension/file.html' ignore missing %}
Code: Select all
$file = $filesystem->realpath(__DIR__ . '/path/file.html');
if ($filesystem->is_readable($file))
{
// File exist, and is readable
}
So, go for twig, because the old style phpBB template syntax is only there for backwards compatibility. Internally all is converted to twig.