[TwigComponent] Simplify macros usage #3123
javiereguiluz
started this conversation in
RFC - Feature Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As explained in the docs (https://symfony.com/bundles/ux-twig-component/current/index.html#using-macros-in-components) you cannot use Twig macros inside components unless you import the full template explicitly:
Using
_self.
is so convenient for calling macros defined in the same template that I think we should improve this to avoid the template import. Some proposals:_self
viaouterScope
:outerMacros
variable with the macros of the current template, similar to the existingouterBlocks
:Thanks!
Beta Was this translation helpful? Give feedback.
All reactions