-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
[5.x] Attribute Modifier #9796
[5.x] Attribute Modifier #9796
Conversation
Does this work for attributes without a value e.g. |
Love this |
Do you mean this? <input type=... {{ mandatory | attribute:required }}> should returns <input type=... required> if <input type=...> if For the moment, if mandatory is <input type=... required="1"> I will update this right now, this is a very good idea, thank you! |
exactly. |
✅ Done. |
Array could be converted to json. Just an idea. Thinking about |
Make sense. Done ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I made just a few tweaks:
- Support for collections
- When an object doesn't have a __toString, let the exception be thrown.
- Simplify tests
This PR adds a new modifier
attribute
to render an HTML attribute for example when the given$value
is not empty (related to this discussion #9323)The main goal is to avoid this:
and to use this instead:
It supports:
required
attribute in an input)__toString()
method)