2017 © Pedro PelĆ”ez
 

jarvis-skill twig-skill

image

mickaelandrieu/twig-skill

  • Thursday, January 28, 2016
  • by mickaelandrieu
  • Repository
  • 0 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

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:, (*1)

<?php

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

$jarvis = new Jarvis\Jarvis([
    'container_provider' => [
        '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:, (*2)

  • 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., (*3)

<?php

require_once('./../vendor/autoload.php');
require_once('./../config.php');

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

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

$response = $jarvis->analyze();

$response->send();

The Versions

28/01 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

24/12 2015

v0.2

0.2.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

24/12 2015

v0.1

0.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires