I write a code generator in Symfony2 with twig.
My problem is: I want to create a twig template with a twig template.
For a better understanding here an example:
I have a twig file that is a template for a PHP Page - so if i run it it generates me PHP code from that twig template. (ex. a Controller for CRUD
)
Now I want to generate the view template - but how can i tell twig to use the commands I need for generation and let the dynamic parts for the template as is?
Can I change how the tags are formed? Can I change {{ varname }}
in [[ varname ]]
?
THX for your help