2017 © Pedro Peláez
 

library twig-extension

A collection of custom extensions for the Twig template engine

image

alexmasterov/twig-extension

A collection of custom extensions for the Twig template engine

  • Sunday, September 25, 2016
  • by AlexMasterov
  • Repository
  • 0 Watchers
  • 0 Stars
  • 57 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Twig Extension(s)

Latest Stable Version License Build Status Code Coverage Scrutinizer Code Quality, (*1)

A collection of custom extensions for the Twig template engine., (*2)

Extensions

Psr7UriExtension — provides useful functions using PSR-7 HTTP message interface., (*3)

Function Description
absolute_url Generate an absolute URL for the given absolute or relative path
relative_path Generate a relative path based on the current path of the URI

Installation

The suggested installation method is via composer:, (*4)

composer require alexmasterov/twig-extension

Configuration

To activate an extension you need to register it into the Twig environment:, (*5)

/*
* @var $twig    Twig_Environment
* @var $request ServerRequestInterface
*/
$twig->addExtension(
    new AlexMasterov\TwigExtension\Psr7UriExtension(ServerRequestInterface $request)
);

The example of registering the extension using Auryn and Diactoros:, (*6)

$injector = new Auryn\Injector;
$injector->alias(
    Psr\Http\Message\ServerRequestInterface::class,
    Zend\Diactoros\ServerRequest::class
);

/*
* @var $twig Twig_Environment
*/
$twig->addExtension(
    $injector->make(AlexMasterov\TwigExtension\Psr7UriExtension::class)
);

The Versions

25/09 2016

dev-master

9999999-dev https://github.com/AlexMasterov/twig-extension

A collection of custom extensions for the Twig template engine

  Sources   Download

MIT

The Requires

 

by Alex Masterov

psr-7 twig extension

25/09 2016

0.4.0

0.4.0.0 https://github.com/AlexMasterov/twig-extension

A collection of custom extensions for the Twig template engine

  Sources   Download

MIT

The Requires

 

by Alex Masterov

psr-7 twig extension

23/09 2016

0.3.0

0.3.0.0 https://github.com/AlexMasterov/twig-extension

A collection of custom extensions for the Twig template engine

  Sources   Download

MIT

The Requires

 

by Alex Masterov

psr-7 twig extension

20/04 2016

0.2.0

0.2.0.0 https://github.com/AlexMasterov/twig-extension

A collection of custom extensions for the Twig template engine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alex Masterov

psr-7 twig extension

17/04 2016

0.1.0

0.1.0.0 https://github.com/AlexMasterov/twig-extension

A collection of custom extensions for the Twig template engine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Alex Masterov

psr-7 twig