2017 © Pedro Peláez
 

library twig-skill

image

eric-chau/twig-skill

  • Wednesday, September 27, 2017
  • by eric-chau
  • Repository
  • 1 Watchers
  • 0 Stars
  • 94 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Twig skill

This skill is an integration of Twig into Jarvis micro-framework., (*1)

What it brings

When this skill is enabled, it brings:, (*2)

  • $app['twig'] service, an unique instance of \Twig_Environment.
  • On $app['twig'] first call, the event Jarvis\Skill\Twig\TwigReadyEvent (event name: twig.ready) will be broadcasted. Note that TwigReadyEvent is a permanent event.
  • In all Twig templates, the variable router (=$app['router']) is available.

Configuration options

You must add a 'twig' key in the 'extra' section to pass your options:, (*3)

<?php

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

$app = new Jarvis\Jarvis([
    'providers' => [
        'Jarvis\Skill\Twig\TwigCore',
    ],
    'extra' => [
        twig' => [
            'templates_paths' => '/path/to/templates',
        ],
    ],
]);

Note that templates_paths is a required parameter. Other options:, (*4)

  • debug: if not provided, Jarvis debug parameter is used.
  • auto_reload: true by default.
  • strict_variables: true by default.

You can see complete options list on Twig documentation., (*5)

The Versions

27/09 2017

dev-master

9999999-dev

  Sources   Download

The Requires

 

The Development Requires

12/10 2016

v1.0.1

1.0.1.0

  Sources   Download

The Requires

 

26/09 2016

v1.0.0

1.0.0.0

  Sources   Download

The Requires

 

17/10 2015

0.1.x-dev

0.1.9999999.9999999-dev

  Sources   Download

The Requires