-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] Add form_label_content and form_help_content block to form_div_layout #45985
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
[TwigBridge] Add form_label_content and form_help_content block to form_div_layout #45985
Conversation
195078f
to
70a19a6
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.
A very minor comment: given that both label and help messages can contain HTML tags and even images (icons, etc.) should the proposed block names be form_label_content
and form_help_content
instead of form_*_text
?
a4377ba
to
31eb8b1
Compare
@javiereguiluz like the suggestion did update it. |
Something missing here? |
src/Symfony/Bridge/Twig/CHANGELOG.md
Outdated
@@ -5,6 +5,7 @@ CHANGELOG | |||
--- | |||
|
|||
* Wrap help messages on form elements in `div` instead of `p` | |||
* Add `form_label_content` and `form_help_content` block to form themes |
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.
Can you please move this to a new 6.2 section?
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.
done
7adc456
to
a40dbea
Compare
Thank you @alexander-schranz. |
… bootstrap 5 layout (Yoann-TYT) This PR was merged into the 6.2 branch. Discussion ---------- [TwigBridge] Adding the new block form_label_content for bootstrap 5 layout | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Adding the new block `form_label_content` for `bootstrap_5_layout.html.twig` to simplify it Linked to [[TwigBridge] Add form_label_content and form_help_content block to form_div_layout](#45985) Commits ------- c2b9bec adding the new block form_label_content for bootstrap_5_layout.html.twig to simplify it
… bootstrap 5 layout (Yoann-TYT) This PR was merged into the 6.2 branch. Discussion ---------- [TwigBridge] Adding the new block form_label_content for bootstrap 5 layout | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Adding the new block `form_label_content` for `bootstrap_5_layout.html.twig` to simplify it Linked to [[TwigBridge] Add form_label_content and form_help_content block to form_div_layout](symfony/symfony#45985) Commits ------- c2b9becda4 adding the new block form_label_content for bootstrap_5_layout.html.twig to simplify it
Add form_label_text and form_help_text block. When it is required to override the
form_label
block a lot uf logic need to be duplicated which is just the translation logic of the label. To make the things easier e.g. when creating alegend
label the newform_label_content
block can be used e.g.:The same I added for the
form_help
which also has some translation logic in it:Already the duplication of the logic in the
bootstrap_4_layout
theme can be avoided this way.With the naming I was not sure first I had
form_label_inner
but thought that maybeform_label_content
would better represent it.