0
0
mirror of https://github.com/anthonyaxenov/iptv.git synced 2024-11-24 22:34:34 +00:00

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

This commit is contained in:
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 [ return [
new TwigFunction('config', [$this, 'config']), new TwigFunction('config', [$this, 'config']),
new TwigFunction('is_file', [$this, 'is_file']),
new TwigFunction('base_url', [$this, 'base_url']), new TwigFunction('base_url', [$this, 'base_url']),
]; ];
} }
@ -26,4 +27,9 @@ class TwigFunctions extends AbstractExtension
{ {
return base_url($path); 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> href="https://axenov.dev">axenov.dev</a>
</footer> </footer>
</div> </div>
{% if is_file("custom/custom.twig") %}
{% include "custom/custom.twig" %} {% include "custom/custom.twig" %}
{% endif %}
</body> </body>
</html> </html>