frizzy/slim-twig-extension

Twig extension for the Slim framework

0.1.2 2014-07-31 10:58 UTC

README

Usage

Add the following to your root composer.json file:

{
    "require": {
        "frizzy/slim-twig-extension": "0.1.*"
    }
}

Add the extension to your Twig environment:

<?php

$twig = new \Twig_Environment(new \Twig_Loader_Filesystem(...));

$twig->addExtension(new \Frizzy\Slim\Twig\Extension);

?>

Functions available in Twig:

  • render_route_name
  • render_route_path
  • render_template
  • path
  • url