0

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.

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Can you please give an example in action?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.