-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a Twig component to display flash messages #6642
base: 4.x
Are you sure you want to change the base?
Conversation
Why not keep |
I don't want to use the exact same namespace because "component" != "component option". But your comment gave me an idea: use the Config/Option namespace inside Twig/Component namespace |
Yes, "component" != "component option", but will this option ever be used outside of configuring the component, or another component ? |
Folks, thanks for the comments and reviews. I made most of the changes you proposed and also changed other things thanks to the comments shared on Symfony Slack. Thanks 🙌 |
We're going to transform the entire UI using Twig Components. We've already have 2 components and this adds the third one.
It's called
Banner
and it can render flash messages / notifications.Some comments:
Banner
to follow GitHub's Primer component naming (https://primer.style/components/banner) I like GitHub components and I'm getting many ideas from them.withDismissButton
andvariant
are also inspired/copied from GtiHub componentsEnum
(the first one in this bundle!; this is fine because we now require PHP 8.1 and enums are supported there) to define the possible values ofvariant
. I opted for the namespaceConfig\Enum\...
because we already haveConfig\Option\...
for the constant-based classes. The idea is to turn (in the future) the constants into enums, so we need a different namespace. Do you likeEnum\
or do you prefer a different name?Thanks!