2017 © Pedro Peláez
 

library twig-loader-flysystem

Flysystem loader for the twig templating language

image

cedricziel/twig-loader-flysystem

Flysystem loader for the twig templating language

  • Thursday, April 27, 2017
  • by cedricziel
  • Repository
  • 3 Watchers
  • 4 Stars
  • 34 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Twig loader for flysystem filesystems

Scrutinizer Code Quality Build Status, (*1)

Flysystem loader for the Twig templating engine., (*2)

Installation

The library is installable through composer:, (*3)

composer require cedricziel/twig-loader-flysystem

Usage

Adapted from the official Twig documentation, (*4)

$localAdapter = new League\Flysystem\Adapter\Local(__DIR__);
$filesystem = League\Flysystem\Filesystem($localAdapter);

$loader = new CedricZiel\TwigLoaderFlysystem\FlysystemLoader($filesystem);
$twig = new \Twig_Environment($loader);

$template = $twig->loadTemplate('index.html.twig');
$content = $template->render(array('the' => 'variables', 'go' => 'here'));

The loader also supports using a subdirectory on the associated flysystem as permanent prefix:, (*5)

$localAdapter = new League\Flysystem\Adapter\Local(__DIR__);
$filesystem = League\Flysystem\Filesystem($localAdapter);

$loader = new CedricZiel\TwigLoaderFlysystem\FlysystemLoader($filesystem, 'templates');
$twig = new \Twig_Environment($loader);

// this will load 'templates/index.html.twig' from the current flysystem filesystem
$template = $twig->loadTemplate('index.html.twig');
$content = $template->render(array('the' => 'variables', 'go' => 'here'));

License

MIT, (*6)

The Versions

27/04 2017

dev-master

9999999-dev https://github.com/cedricziel/twig-loader-flysystem

Flysystem loader for the twig templating language

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cedric Ziel

filesystem twig loader templates flysystem

25/08 2016

v1.1.0

1.1.0.0 https://github.com/cedricziel/twig-loader-flysystem

Flysystem loader for the twig templating language

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cedric Ziel

filesystem twig loader templates flysystem

06/07 2016

v1.0.0

1.0.0.0 https://github.com/cedricziel/twig-loader-flysystem

Flysystem loader for the twig templating language

  Sources   Download

MIT

The Requires

 

The Development Requires

by Cedric Ziel

filesystem twig loader templates flysystem