2017 © Pedro Peláez
 

library twigenv

Twig extension, helps to define environment specific code in templates

image

kobylinski/twigenv

Twig extension, helps to define environment specific code in templates

  • Sunday, June 2, 2013
  • by kobylinski
  • Repository
  • 1 Watchers
  • 2 Stars
  • 163 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Twig env tag

To change configuration you have to remove cached templates., (*1)

Usage

    $twig = new Twig_Environment(new Twig_Loader_Filesystem('/path/to/templates'));
    $twig->addTokenParser(new \TwigEnv\TokenParser('environment'));
  {% env 'production' %}
    <div>Production specific fragment of code</div>
  {% env 'development' %}
    <div>Development specific fragment of code</div>
  {% env not 'production' %}
    <div>Match any environment, except production</div>
  {% env 'development_*' %}
    <div>Match any environment with name starting with "development_"</div>
  {% env not %}
    <div>In unknown environment</div>
  {% endenv %}

The Versions

02/06 2013

dev-master

9999999-dev https://github.com/kobylinski/twig-env

Twig extension, helps to define environment specific code in templates

  Sources   Download

MIT

The Requires

 

by Marek Kobylinski

twig environment