Ссылка на коммит в подвале

Требует установку гит-хуков
This commit is contained in:
2022-09-12 22:34:05 +08:00
parent acf1f8083f
commit 585392b295
8 changed files with 39 additions and 18 deletions

View File

@@ -13,6 +13,7 @@ class TwigFunctions extends AbstractExtension
{
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']),
];
@@ -23,6 +24,11 @@ class TwigFunctions extends AbstractExtension
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);