How to get the output of __toString() when using d

2019-08-18 11:23发布

问题:

The twig documentation says:

debug boolean

When set to true, the generated templates have a __toString() method that you can use to display the generated nodes (default to false).

Which sounds fabulous but how do I actually make use of it? I mean in which file and on which object would I call __toString() on?

It says that it's on "the generated templates" – whatever that means. I've tried doing $this->__toString() from within a generated template but it doesn't recognise that method (and yes I've confirmed that the debug option is enabled).

标签: twig