Do you see such Twig Extensions interesting for Symfony/UX? #2936
Replies: 3 comments 2 replies
-
Thanks for considering us! I don't think such a library embraces the Symfony UX philosophy, here it's purely backend and nothing about frontend, right? Or am I missing something? |
Beta Was this translation helpful? Give feedback.
-
This looks a bit like what KnpMenuBundle does, but with a different API to configure. KnpMenuBundle does not use route options as the way to configure this, as that's not easy to access in a performant way (route options are not exposed in cached APIs of the router) and less flexible (what if multiple navigation contexts should include links to the same route ?) |
Beta Was this translation helpful? Give feedback.
-
Feel free to share if you have other stuff too :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I created a whole Extranet like library for a client based on some symfony ux and a lot of stimulus / turbo stuff. In this library we have three I think very usefull Twig extension which might be nice for symfony UX itself.
Navigation Twig Extension
The navigation twig extension uses Route Options to create a Navigation. Based on
navigationContext
andnavigationContextSection
options.Tab Twig Extension
If the current route has a
tabGroup
all items with the sametabGroup
are returned here.Breadcrumb Twig Extension
If the current route has a
breadcrumbParent
all parents item are returned here.Example of our route definitions. As it are
options
you could also use attributes,php
orxml
route definitions.We are using
.yaml
as it is easier to control the order of the items instead of have a additional priority but that could be added.:Beta Was this translation helpful? Give feedback.
All reactions