improvements-2.x-dev/modules/improvements_site_information/src/ImprovementsSiteInformationTwigExtension.php
modules/improvements_site_information/src/ImprovementsSiteInformationTwigExtension.php
<?php namespace Drupal\improvements_site_information; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; /** * Twig extensions. */ class ImprovementsSiteInformationTwigExtension extends AbstractExtension { /** * {@inheritdoc} */ public function getFunctions(): array { return [ new TwigFunction('site_information', [$this, 'siteInformation']), ]; } /** * Return site information. */ public function siteInformation(string|array $setting_key = NULL): array|string { return improvements_get_site_information($setting_key); } }