Open alexz707 opened 7 months ago
Hey @alexz707 ,
The best way probably is to not use that SubmitType::class
at all and instead put the button component manually in your form :)
Otherwise, you would need to override some core form templates which would lead to some duplications or code complications.
Cheers!
Hey @bocharsky-bw,
thanks for your answer. Of course I could remove the button and use the component in the template but that just hides the problem I guess ;)
What if I want to style other elements by using components. currently as you mentioned the only way would be to edit the styles (or whatever you want to change) in 2 different locations.
So using the components is only 50% "of the job" are there any plans or ideas to get to 100% ?
Best regards alex
Hey @alexz707 ,
This sounds fair, but fairly speaking i'm not sure about it. The problem is that there're 2 different "syntax" or how to name it, form themes has their own syntax for the windgets, etc, and you can't just re-use the same HTML code for both. What about styles (in specific, CSS classes) - it's easier I think. You can probably set it on a var and reuse it in both places. I'm not sure how that should work out of the box, but sure, it would be good to have some. If you have any ideas, or want to help with it by contributing into Symfony - PRs are warmly welcome.
Hey @weaverryan ! thanks for making this great course!
I'm trying to set up a new project using tailwind with the flowbite-bundle and symfony ux components. I've created the Button component from the tutorial with some css classes so it looks like the flowbite admin dashboard and works really fine as long as I just use twig templates.
Now I would like to use a form type class e.g.
ChangePasswordType.php
. In that class i have added a buttonHow can I use my button component to get the correct classes? Because now it uses the twig templates from flowbite-bundle and I would need to overwrite these entries manually:
My button component looks like this:
So currently I would need to overwrite the flowbite template and would have the css definition in two places - in the button component as well as in the forms template.
Maybe I missunderstood something but I could not find out how to use just the components ;-) What is the best way to do this?
Best regards Alex