2017 © Pedro Peláez
 

library twig-eval-extension

Provides eval as a function in your twig templates.

image

jaem3l/twig-eval-extension

Provides eval as a function in your twig templates.

  • Friday, December 22, 2017
  • by dbrumann
  • Repository
  • 3 Watchers
  • 3 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 100 % Grown

The README.md

TwigEvalExtension

One of the goals of Twig is to limit the amount of logic in your templates. Unfortunately you won't be able to do all sorts of stuff you can do with PHP. To regain that power you can use TwigEvalExtension. Just write your php code inside an eval() template function and it gets passed to PHP's eval and you will get the result., (*1)

Installation

You can install the extension by using composer require., (*2)

Example Usage

Using the eval function:, (*3)

{{ eval('echo 1+1;') }}

Using the eval tag:, (*4)

{% eval %}
    echo file_get_contents("/var/log/system.log");
{% endeval %}

Tests

Just run, (*5)

$ vendor/bin/phpunit tests/EvalExtensionTest.php

No pesky phpunit.xml needed., (*6)

Contribution

Please don't., (*7)

Known Issues

It's eval in your templates. What could possibly go wrong?!, (*8)

The Versions

22/12 2017

dev-master

9999999-dev

Provides eval as a function in your twig templates.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Denis Brumann

22/12 2017

v1.0.0

1.0.0.0

Provides eval as a function in your twig templates.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Denis Brumann