Nick Doulgeridis
Nick Doulgeridis

Reputation: 613

Symfony 2 and Twig from MySql

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

Answers (1)

lilobase
lilobase

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

Related Questions