sgomez/simplesamlphp-module-twig

A SimpleSAMLphp module adding support for the Twig template library.

Installs: 117

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:simplesamlphp-module

v1.0.2 2016-03-27 01:04 UTC

This package is auto-updated.

Last update: 2024-10-27 19:22:44 UTC


README

#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.