Фикс несуществуеющего custom.twig

master
Anthony Axenov 2022-09-04 14:28:57 +08:00
parent 17ecc60497
commit 1edf1d8455
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
2 changed files with 9 additions and 1 deletions

View File

@ -13,6 +13,7 @@ class TwigFunctions extends AbstractExtension
{
return [
new TwigFunction('config', [$this, 'config']),
new TwigFunction('is_file', [$this, 'is_file']),
new TwigFunction('base_url', [$this, 'base_url']),
];
}
@ -26,4 +27,9 @@ class TwigFunctions extends AbstractExtension
{
return base_url($path);
}
public function is_file(string $path): bool
{
return is_file($path);
}
}

View File

@ -65,6 +65,8 @@
href="https://axenov.dev">axenov.dev</a>
</footer>
</div>
{% include "custom/custom.twig" %}
{% if is_file("custom/custom.twig") %}
{% include "custom/custom.twig" %}
{% endif %}
</body>
</html>