fabpot/Twig-extensions — pull request #53 by triplejumper12 (2012-04-24 18:54:11+00:00)
Title: Added Eval extension

I made an extension that adds an eval filter that can be called on twig code passed into a template to evaluate the string as code.

ie. twig->render(..path.., array('pattern' => '{{ key }}-{{ value }}', 'information' => array('somekey' => 'somevalue')))

In the template at ..path..: {% for key,value in information %}{{ pattern|eval }}{% endfor %} will evaluate to return "somekey-somevalue".