2017 © Pedro Peláez
 

project twig-cli

CLI for the Twig template engine

image

xrash/twig-cli

CLI for the Twig template engine

  • Wednesday, April 13, 2016
  • by xrash
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Twig CLI

Installation:

$ wget https://github.com/xrash/twig-cli/raw/master/bin/twig.phar -O /tmp/twig.phar
$ chmod +x /tmp/twig.phar
$ sudo mv /tmp/twig.phar /usr/local/bin/twig

One liner:, (*1)

$ wget https://github.com/xrash/twig-cli/raw/master/bin/twig.phar -O /tmp/twig.phar && chmod +x /tmp/twig.phar && sudo mv /tmp/twig.phar /usr/local/bin/twig

Usage:

Passing files as arguments:, (*2)

$ twig file1.html.twig file2.html.twig > result.html

Processing the input through STDIN:, (*3)

$ cat file.html.twig | twig > result.html

Using inline parameters:, (*4)

$ cat file.html.twig | twig -p title="My Title" -p env=dev > result.html

TODO

  • Accept parameters from JSON and/or YAML files.
  • Option to process every .twig file (recursively) inside a directory and outputting in another one.
  • Option to load an internal Twig Environment (from a given directory), then processing the input as a template name instead of a filename.

The Versions

13/04 2016

dev-master

9999999-dev

CLI for the Twig template engine

  Sources   Download

MIT

The Requires