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
navigationContextandnavigationContextSectionoptions.{% set navigationItems = get_static_navigation('main') %}Tab Twig Extension
If the current route has a
tabGroupall items with the sametabGroupare returned here.{% set tabItems = get_static_tabs() %}Breadcrumb Twig Extension
If the current route has a
breadcrumbParentall parents item are returned here.{% set breadcrumbItems = get_static_breadcrumb() %}Example of our route definitions. As it are
optionsyou could also use attributes,phporxmlroute definitions.We are using
.yamlas 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