mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-02-02 22:47:16 +00:00
36 lines
805 B
PHP
36 lines
805 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\MainBundle\Templating;
|
|
|
|
use Chill\MainBundle\Service\VersionProvider;
|
|
use Twig\Extension\AbstractExtension;
|
|
use Twig\TwigFunction;
|
|
|
|
class VersionRenderExtension extends AbstractExtension
|
|
{
|
|
public function __construct(
|
|
private readonly VersionProvider $versionProvider,
|
|
) {}
|
|
|
|
public function getFunctions(): array
|
|
{
|
|
return [
|
|
new TwigFunction('get_chill_version', $this->getChillVersion(...)),
|
|
];
|
|
}
|
|
|
|
public function getChillVersion(): string
|
|
{
|
|
return $this->versionProvider->getFormattedVersion();
|
|
}
|
|
}
|