-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Add label_html attribute #31375
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
Conversation
As described in #31358 I think it totally make sense to have label_html attribute in it as we also have help_html attribute. 👍 for this. |
@przemyslaw-bogusz the label is also used inside the button example and could contain html there also see: https://github.com/symfony/symfony/pull/31358/files |
Hi, just wondering will this make it into Symfony 4.3? |
@AndreasA I've been busy preparing for SymfonyLive in Warsaw, but that's on the list of my priorities, so I will fix the tests and complete it as soon as I can. However, it doesn't mean it will be automatically approved. If you like the idea, give it a 'thumbs up' or leave a positive comment. |
I think this would be really helpful. Especially in combination with the |
d92e2a8
to
05a1c39
Compare
@przemyslaw-bogusz the tests seems to fail because $label_html is not define in the form_label.html.php not sure how this happens maybe you can try to debug the tests and try to fix it? |
05a1c39
to
5a50ee8
Compare
I've tried a different approach by implementing this feature in |
a23d9eb
to
fc0ee8f
Compare
fc0ee8f
to
46f625f
Compare
2617c46
to
b4c0924
Compare
@xabbuh I have started working on this some time ago, but I had problem with a single space, that which caused the tests to fail. I have fixed this, but there is still some issue with Travis on PHP 7.4. I could really use some help to solve this out, because there are a few people, who like this proposition - #35598. |
@przemyslaw-bogusz I think making sure that the Twig bridge always gets the Form component in version 5.1 or higher should solve it. We would need to make some changes to the Twid bridge's
|
@xabbuh Thanks a lot. That solved the issue. However, now there is a single test in Cache Component failing. |
It looks like this PR contains not related commits. Can you rebase and force push? |
3fb25c0
to
7037723
Compare
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.
(I rebased + squashed)
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! We also need a note in the form component CHANGELOG.
I have updated the form component changelog. Sorry for the mess with the commits and thanks for the cleanup. |
5a25ef1
to
ab9f795
Compare
ab9f795
to
02d9f0b
Compare
I removed the CHANGELOG update, and without AppVeyor CI is green again. |
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.
Nice and useful feature!
02d9f0b
to
239fe04
Compare
Thank you @przemyslaw-bogusz. |
@przemyslaw-bogusz good work nice to see this merged! |
@alexander-schranz Thanks! I wish you all the best in future PRs. |
…bogusz) This PR was squashed before being merged into the master branch (closes #13316). Discussion ---------- [Form] Add description of label_html option | Q | A | ------------- | --- | Feature PR | symfony/symfony#31375 | PR author(s) | @przemyslaw-bogusz | Merged in | WCM Commits ------- 7a74bb3 [Form] Add description of label_html option
…rzemyslaw-bogusz) This PR was squashed before being merged into the master branch (closes #13409). Discussion ---------- [Validator] Add description for AtLeastOne constraint | Q | A | ------------- | --- | Feature PR | symfony/symfony#31375 | PR author(s) | @przemyslaw-bogusz | Merged in | 5.1-dev | Fixes | #13355 Commits ------- 5ba5224 [Validator] Add description for AtLeastOne constraint
I propose to add a new attribute to
BaseType
class so it is easy to include html tags in labels for, both, buttons and other elements that inherit fromFormType
class. This gives you an ability to add, e.g. a glyphicon to a button, or a link to a checkbox, simply inside theFormBuilder
, which means you can just do{{ form(form) }}
inside a template.
Sidenotes