-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Introspection of parsed template #578
Comments
Exactly what I am doing in a different branch, but tied to a specific feature so won't be merged soon. When you have the list of Statements, try to find the implementation : This tag is coming from here I believe you are now familiar of what this code does. The issue that I am seeing is that it ultimately calls into Line 548 in 8564be1
ParserTagStatement . I could suggest that you customize the FluidViewParser instance by calling RegisterExpressionTag("layout", ... again but returning a Statement type that would have the name of the tag in it.
Or, you could submit a PR that add the tag information to the current class (maybe event |
Appreciate the reply. I'm happy to have a crack at doing a PR for |
PR submitted for review |
@sebastienros I was trying to understand the best approach to solve my problem and I thought that maybe I should use a custom parser tag but if you are working on a similar feature or something that could help solve my problem I could wait or fork your branch. But I can't find an updated branch so maybe it's private? |
@MithrilMan I have a PR open for this here #579 |
I have finally added visitors, here is the PR. Please check the README for usage examples and let me know if that will work for you. |
I am closing as the feature has shipped |
Is it possible to introspect tags within a parsed template?
I know that
FluidTemplate
contains a list ofStatement
s but I don't see a way of viewing the tag name and arguments.What I'm trying to do is look at the layout being used when rendering to do some things before giving it to Fluid to render.
i.e.
I would like to be able to find the tag that is specific for
layout
and then get the valuemylayout.liquid
from that tag.Thanks :)
The text was updated successfully, but these errors were encountered: