Skip to content

Commit

Permalink
feat: Recuperation de l'adapteur utilisé pour la génération des vues
Browse files Browse the repository at this point in the history
  • Loading branch information
dimtrovich committed Apr 30, 2024
1 parent 2796e3a commit c60b544
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Config/Providers.php
Expand Up @@ -30,12 +30,14 @@ private static function interfaces(): array
{
return [
\BlitzPHP\Contracts\Autoloader\LocatorInterface::class => static fn () => service('locator'),
\BlitzPHP\Contracts\Container\ContainerInterface::class => static fn () => service('container'),
\BlitzPHP\Contracts\Event\EventManagerInterface::class => static fn () => service('event'),
\BlitzPHP\Contracts\Mail\MailerInterface::class => static fn () => service('mail'),
\BlitzPHP\Contracts\Router\RouteCollectionInterface::class => static fn () => service('routes'),
\BlitzPHP\Contracts\Security\EncrypterInterface::class => static fn () => service('encrypter'),
\BlitzPHP\Contracts\Session\CookieManagerInterface::class => static fn () => service('cookie'),
\BlitzPHP\Contracts\Session\SessionInterface::class => static fn () => service('session'),
\BlitzPHP\Contracts\View\RendererInterface::class => static fn () => service('viewer')->getAdapter(),
\Psr\Container\ContainerInterface::class => static fn () => service('container'),
\Psr\Http\Message\ResponseInterface::class => static fn () => service('response'),
\Psr\Http\Message\ServerRequestInterface::class => static fn () => service('request'),
Expand Down
8 changes: 8 additions & 0 deletions src/View/View.php
Expand Up @@ -378,6 +378,14 @@ public function setAdapter(string $adapter, array $config = []): static
return $this;
}

/**
* Recupere l'adapter utilisé pour générer les vues
*/
public function getAdapter(): RendererInterface
{
return $this->adapter;
}

/**
* Renvoie les données de performances qui ont pu être collectées lors de l'exécution.
* Utilisé principalement dans la barre d'outils de débogage.
Expand Down

0 comments on commit c60b544

Please sign in to comment.