I'm trying Twig (currently I'm noob in twig it's my first time). This is what I am doing:
main.tpl
<!DOCTYPE html>
<html>
{% include 'header.tpl' %}
<body>
{% include 'logo.tpl' %}
content
{% include 'footer.tpl' %}
</body>
</html>
index.php
<?php
require_once PLUGIN_PATH.'Twig/Autoloader.php';
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem(VIEWS_PATH);
$options = [
'autoescape' => false,
'strict_variables' => false
];
$twig = new Twig_Environment($loader, $options);
$template = $twig->loadTemplate('main.tpl);
echo $template->render(['title' => 'myTemplate']);
?>
header.tpl
<head>
<!-- head content -->
</head>
logo.tpl
<img src="logo.png">
Up to this point everything is fine (apparently), but in the folder of my development there is no logo.png, so I know that I will throw an error in the console, but to my surprise the error throws it twice.
If I try to reproduce another error (such as putting another image without source) it shows me the error twice as well. It's weird because the layout's html does not duplicate it but for some strange reason the error does.
Is this normal? Or what am I doing wrong?