Фикс несуществуеющего custom.twig
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user