Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@alexander-schranz
Copy link
Contributor

@alexander-schranzalexander-schranz commentedApr 10, 2022
edited
Loading

QA
Branch?6.1
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix #...
LicenseMIT
Doc PRsymfony/symfony-docs#...

Add form_label_text and form_help_text block. When it is required to override theform_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.:

{%-block_custom_label -%}    <legend>        {{-block('form_label_content') -}}    </legend>{%-endblock -%}

The same I added for theform_help which also has some translation logic in it:

{%-block_custom_help -%}    <divclass="custom-help">        {{-block('form_help_content') -}}    </div>{%-endblock -%}

Already the duplication of the logic in thebootstrap_4_layout theme can be avoided this way.

With the naming I was not sure first I hadform_label_inner but thought that maybeform_label_content would better represent it.

@carsonbotcarsonbot changed the titleAdd form_label_text and form_help_text block to form_div_layout[TwigBridge] Add form_label_text and form_help_text block to form_div_layoutApr 11, 2022
@alexander-schranzalexander-schranzforce-pushed thefeature/form-theme-text-block branch from195078f to70a19a6CompareApril 11, 2022 18:19
Copy link
Member

@javiereguiluzjaviereguiluz left a 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 beform_label_content andform_help_content instead ofform_*_text ?

@alexander-schranzalexander-schranzforce-pushed thefeature/form-theme-text-block branch 2 times, most recently froma4377ba to31eb8b1CompareApril 26, 2022 20:37
@alexander-schranzalexander-schranz changed the title[TwigBridge] Add form_label_text and form_help_text block to form_div_layout[TwigBridge] Add form_label_content and form_help_content block to form_div_layoutApr 26, 2022
@alexander-schranz
Copy link
ContributorAuthor

@javiereguiluz like the suggestion did update it.

@alexander-schranz
Copy link
ContributorAuthor

Something missing here?

---

* Wrap help messages on form elements in`div` instead of`p`
* Add`form_label_content` and`form_help_content` block to form themes

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?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

done

@chalasrchalasrforce-pushed thefeature/form-theme-text-block branch from7adc456 toa40dbeaCompareMay 31, 2022 21:46
@chalasr
Copy link
Member

Thank you@alexander-schranz.

@chalasrchalasr merged commitd096349 intosymfony:6.2May 31, 2022
fabpot added a commit that referenced this pull requestOct 15, 2022
… 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 (seehttps://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 followhttps://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (seehttps://symfony.com/bc).-->Adding the new block `form_label_content` for `bootstrap_5_layout.html.twig` to simplify itLinked 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
symfony-splitter pushed a commit to symfony/twig-bridge that referenced this pull requestOct 15, 2022
… 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 (seehttps://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 followhttps://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (seehttps://symfony.com/bc).-->Adding the new block `form_label_content` for `bootstrap_5_layout.html.twig` to simplify itLinked 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
@fabpotfabpot mentioned this pull requestOct 24, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@stofstofstof approved these changes

@xabbuhxabbuhAwaiting requested review from xabbuh

@ycerutoycerutoAwaiting requested review from yceruto

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

7 participants

@alexander-schranz@chalasr@javiereguiluz@nicolas-grekas@stof@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp