fabpot/Twig-extensions — pull request #68 by triplejumper12 (2012-09-25 20:34:42+00:00)
Title: Feature/eval

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

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

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