Open knightmeister opened 1 month ago
I will check that. From a brief look at the source the layout tag is of type ParserTagStatement. Maybe filtering statements for this type and then casting would allow you to access the expression it links to. Not sure if this type is public yet.
Thanks
Can't cast to ParserTagStatement
Hi,
I raised #578 and submitted a PR that received no comment and it looks like the advice now is to use the Visitor supports that's been recently added.
There is an example in the readme but it doesn't demonstrate what I need to do.
I need to walk the template and find instances of a given tag (in my case,
{% layout '[id]' %}
).I want to be able to extract both the tag name (layout) and the input ID.
How do I do that using a Visitor?
Starting with a contrived example:
The
Statement
method breakpoints but I'm unable to access anything on the statement that is passed in. The only method isWriteToAsync
and there are no properties.How do I extract the statement name and passed parameter?
Cheers