Разделение по отдельным репозиториям

This commit is contained in:
2025-03-03 16:31:32 +08:00
commit a1f5154ce8
44 changed files with 4362 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace App\Core;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
class TwigExtention extends AbstractExtension
{
public function getFunctions(): array
{
return [
new TwigFunction('config', [$this, 'config']),
new TwigFunction('commit', [$this, 'commit']),
new TwigFunction('is_file', [$this, 'is_file']),
new TwigFunction('base_url', [$this, 'base_url']),
];
}
public function config(string $key, mixed $default = null): mixed
{
return config($key, $default);
}
public function commit(): string
{
return file_get_contents(root_path('commit'));
}
public function base_url(string $path = ''): string
{
return base_url($path);
}
public function is_file(string $path): bool
{
return is_file($path);
}
}