This commit is contained in:
1 parent
054e970df9
commit
1c98a634c3
50 files changed
+1666
-593
No files matched your search
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Twig;
|
||||
|
||||
use App\Service\RegistrationToggle;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\Extension\GlobalsInterface;
|
||||
|
||||
/**
|
||||
* Exposes frequently used configuration values to Twig templates.
|
||||
*/
|
||||
class AppSettingsExtension extends AbstractExtension implements GlobalsInterface
|
||||
{
|
||||
public function __construct(private readonly RegistrationToggle $registrationToggle)
|
||||
{
|
||||
}
|
||||
|
||||
public function getGlobals(): array
|
||||
{
|
||||
return [
|
||||
'registration_enabled' => $this->registrationToggle->isEnabled(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user