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
unload_rendered is used to prevent duplicate controllers.
The problem here is that if I wanted to use bootstrap_4_horizontal_layout.html.twig instead, I would need to create another file (am I wrong about this?).
It becomes an even bigger problem for reusable bundles or FormExtensions that want to attach their own controllers (like having 2-3 of them, each with its own logic).
It would have been much easier if the same can be provided via PHP.
The idea
FormView::vars could get another array property called stimulus_controllers.
Then in Twig, template block widget_attributes would read and render them unescaped (this is the biggest issue I had with attributes approach).
I find Stimulus great to improve forms. There is just one problem that I may not know how to solve so here comes an example:
My root form has controller
unload
that will ask user to confirmturbo:visit
if FormData has been changed. And it works but the code is a problem:My theme.twig
unload_rendered
is used to prevent duplicate controllers.The problem here is that if I wanted to use
bootstrap_4_horizontal_layout.html.twig
instead, I would need to create another file (am I wrong about this?).It becomes an even bigger problem for reusable bundles or FormExtensions that want to attach their own controllers (like having 2-3 of them, each with its own logic).
It would have been much easier if the same can be provided via PHP.
The idea
FormView::vars
could get another array property calledstimulus_controllers
.Then in Twig, template block
widget_attributes
would read and render them unescaped (this is the biggest issue I had with attributes approach).End use
which would render
If there was a registered
FormExtension
forTextType
that add its ownalways-added
controller:FormView example:
WDYT? Does the idea even make sense?
The text was updated successfully, but these errors were encountered: