Skip to content

Commit 98ebeda

Browse files
authored
Update TwigServiceProvider.php
1 parent fb6631f commit 98ebeda

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Provider/TwigServiceProvider.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use League\Container\ServiceProvider\AbstractServiceProvider;
66
use Odan\Session\SessionInterface;
7+
use Cosmic\Core\Extension\DateExtension;
78
use Slim\App;
89
use Slim\Views\Twig;
910
use Slim\Views\TwigRuntimeLoader;
@@ -50,6 +51,9 @@ public function register()
5051
(new \Slim\Psr7\Factory\UriFactory)->createFromGlobals($_SERVER)
5152
)
5253
);
54+
55+
$twig->addExtension(new DateExtension());
56+
5357
$this->registerGlobals($twig->getEnvironment());
5458
$this->registerFunctions($twig->getEnvironment());
5559

@@ -68,9 +72,9 @@ public function getLanguage($string, $placeholders = []): string
6872

6973
/**
7074
* @param $string
71-
* @return string|array
75+
* @return string
7276
*/
73-
public function getConfig($string): string | array
77+
public function getConfig($string): string | null
7478
{
7579
$container = $this->getContainer();
7680
$config = $container->get(Config::class);

0 commit comments

Comments
 (0)