Skip to content

sgomez/simplesamlphp-module-twig

Repository files navigation

#SimpleSAMLphp Composer Twig module

This package add support for the twig template library through a SimpleSAMLphp module installable through Composer. Installation can be as easy as executing:

composer.phar require sgomez/simplesamlphp-module-twig ~1.0

##Using templates

This module search in all active modules this directory structure: modulename/resources/templates/ and create a namespace for each module that has one.

Render a template is as easy as this:

$engine = \SimpleSAML\Modules\Twig\TwigEngine::getInstance();
echo $engine->render('@modulename/template.html.twig');

##Using translations

This module uses the symfony/translation library to search translations files in yml format on the next directory: modulename/resources/translations/.

The filename must have the next format: modulename.locale.yml

##Twig and translations

This bundle uses the Symfony Twig Extension on twig-bridge library. So basically you can use the same filters and blocks than Symfony.

About

A SimpleSAMLphp module adding support for the Twig template library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages