v0.2 2015-12-24 14:43 UTC

This package is auto-updated.

Last update: 2024-07-05 17:29:32 UTC


Twig integration in Jarvis micro framework


you need to install it using composer and then be sure that this configuration is available when Jarvis Application is started:


require_once __DIR__.'/vendor/autoload.php';

$jarvis = new Jarvis\Jarvis([
    'container_provider' => [
    '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.



use Jarvis\Jarvis;
/* ... */

$jarvis->router->addRoute('get', '/', function ($jarvis) {
    return $jarvis->twig->render('index.twig', ['world' => 'World']);

$response = $jarvis->analyze();