You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking for a hook in twig engine with that I can transform something like
<foo bar="baz" />
into
{{ func("foo", { bar: "baz" } ) }}
I am not sure how I can achieve this and where in the compilation process this must happen. Is this a NodeVisitor or rather responsibility of a TokenParser? Or something completely else? Should this maybe happen at FileLoader / Cache level and with regex replacing? Unfortunately the twig documentation does not cover such a topic in depth.
Looking forward for any advices and tips, thank you.
PS: I know I could just simply put the second snippet in the template but I want to provide the first snippet as some kind of nice-to-have option that will be converted to the second snippet.
The text was updated successfully, but these errors were encountered:
AndreRudolph
changed the title
Transform HTML Tag to twig tag
Question: Transform HTML like Tag to TWIG tag
Aug 11, 2023
I am looking for a hook in twig engine with that I can transform something like
<foo bar="baz" />
into
{{ func("foo", { bar: "baz" } ) }}
I am not sure how I can achieve this and where in the compilation process this must happen. Is this a NodeVisitor or rather responsibility of a TokenParser? Or something completely else? Should this maybe happen at FileLoader / Cache level and with regex replacing? Unfortunately the twig documentation does not cover such a topic in depth.
Looking forward for any advices and tips, thank you.
PS: I know I could just simply put the second snippet in the template but I want to provide the first snippet as some kind of nice-to-have option that will be converted to the second snippet.
The text was updated successfully, but these errors were encountered: