V
V
vladimircape2014-10-21 19:51:00
symfony
vladimircape, 2014-10-21 19:51:00

Symfony 2: How to display twig template and its variables?

The task is to edit twig templates for mailing letters in the admin panel, the usual render outputs without {{ title }} such elements, there may be some elegant solution than stupidly taking the property of the object.
so far, except as a substitute for lexer, I have not found

$lexer = new \Twig_Lexer($twig, array(
        'tag_comment'   => array('[#', '#]'),
        'tag_block'     => array('[%', '%]'),
        'tag_variable'  => array(''),
        'interpolation' => array('#[', ']'),
    ));
        $twig->setLexer($lexer);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BoShurik, 2014-10-21
@BoShurik

https://www.techpunch.co.uk/development/render-str...
twig.sensiolabs.org/doc/functions/template_from_st...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question