feat(twig/templates): register

This commit is contained in:
Jérémy Dufraisse 2023-03-11 10:58:10 +01:00
parent 245487ad7f
commit 527f59f07e
3 changed files with 24 additions and 0 deletions

View File

@ -35,4 +35,20 @@ class SeacmsAuth extends AbstractPicoPlugin implements ApiAware
{ {
return new JsonResponse(200,['connected'=>false]); return new JsonResponse(200,['connected'=>false]);
} }
/**
* Triggered when Pico registers the twig template engine
*
* @see Pico::getTwig()
*
* @param Twig_Environment &$twig Twig instance
*/
public function onTwigRegistered(Twig_Environment &$twig)
{
$twigLoader = $twig->getLoader();
$templateDir = $this->getPluginsDir().'SeacmsAuth/templates';
if (is_dir($templateDir)){
$twigLoader->addPath($templateDir, 'SeacmsAuth');
}
}
} }

View File

@ -0,0 +1,5 @@
{# SPDX-License-Identifier: EUPL-1.2 #}
{# Authors: see README.md #}
<!-- SeacmsAuth Header TODO -->

View File

@ -0,0 +1,3 @@
{# SPDX-License-Identifier: EUPL-1.2 #}
{# Authors: see README.md #}
<!-- SeacmsAuth Header Styles TODO -->