https://github.com/mickaelandrieu/twig-skill
Twig templating engine integration into Jarvis micro framework
https://github.com/mickaelandrieu/twig-skill
Last synced: 7 months ago
JSON representation
Twig templating engine integration into Jarvis micro framework
- Host: GitHub
- URL: https://github.com/mickaelandrieu/twig-skill
- Owner: mickaelandrieu
- Created: 2015-09-15T15:52:08.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-28T13:14:11.000Z (over 9 years ago)
- Last Synced: 2025-02-28T20:48:31.696Z (8 months ago)
- Language: PHP
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Twig integration in Jarvis micro framework
## Installation
you need to install it using composer and then be sure that this configuration
is available when Jarvis Application is started:```php
[
'Jarvis\Skill\Twig\ContainerProvider',
],
'twig' => [
'templates_paths' => '/path/to/templates',
],
]);
```Note that `templates_paths` is a required parameter. This skill changes default values for some options:
- `debug`: if not provided, this value take the value of Jarvis `debug` parameter.
- `auto_reload`: this is setted to `true` as default value in this skill.
- `strict_variables`: this option is also setted to `true` by default.You can see complete options list on [Twig documentation](http://twig.sensiolabs.org/doc/api.html#environment-options).
```php
router->addRoute('get', '/', function ($jarvis) {
return $jarvis->twig->render('index.twig', ['world' => 'World']);
});$response = $jarvis->analyze();
$response->send();
```