Reputation: 613
I am trying to create a basic CMS in Symfony2. Is it possible to "translate" twig code from mysql to controller somehow?
For example let say in mysql there is
{% include 'FOO::FOO.html.twig' %}
When I get it from orm how to make it load the template instead of just echo
{% include 'FOO::FOO.html.twig' %}
Thanks a lot.
Upvotes: 0
Views: 151
Reputation: 441
You can use the internal Lexer, parser and compiler of twig to get a php object representation of your templates:
http://twig.sensiolabs.org/doc/internals.html
Upvotes: 1