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
Requires
- php: >=5.5.9
- simplesamlphp/composer-module-installer: ~1.0
- symfony/finder: ~2.3|~3.0
- symfony/translation: ~2.3|~3.0
- symfony/twig-bridge: ~2.3|~3.0
- symfony/yaml: ~2.3|~3.0
- twig/twig: ~1.24|~2.0
Requires (Dev)
- simplesamlphp/simplesamlphp: ^1.14
This package is auto-updated.
Last update: 2024-11-27 19:32:27 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.