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 row_attr to all form themes#33573

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
nicolas-grekas merged 1 commit intosymfony:4.3fromfancyweb:twig-bridge-row-attr
Nov 28, 2019

Conversation

@fancyweb
Copy link
Contributor

@fancywebfancyweb commentedSep 13, 2019
edited by javiereguiluz
Loading

QA
Branch?4.3
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#33552
LicenseMIT
Doc PR-

The rules I applied:

  • Always done on the first HTML tag of the row.
  • Current existing row attrs (class orstyle) are applied unless they are defined by therow_attr override. They can be removed if they are explicitly set tofalse.

Starting from:

<div>

Withrow_attr: {foo: "bar"}:

<div foo="bar">

Withrow_attr: {class: "ccc"}:

<div>

Withrow_attr: {foo: "bar", class: false}:

<div foo="bar">

romaricdrigon reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas added this to the4.3 milestoneSep 14, 2019
xabbuh added a commit that referenced this pull requestSep 25, 2019
This PR was merged into the 4.3 branch.Discussion----------Add missing row_attr option to FormType| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix:#33682 - related issue#33573| License       | MITThe#33573 modified Symfony's form themes. But the [FormType](https://github.com/symfony/form/blob/master/Extension/Core/Type/FormType.php) don't allow the option `row_attr` so the OptionResolver throw an exception that the option is unknown.This PR basically add the option and give it to the form view (like `label_attr` do)Commits-------d711ea2 Add missing row_attr option to FormType
@xabbuh
Copy link
Member

@fancyweb FYI,#33688 has been merged

@fancyweb
Copy link
ContributorAuthor

Here is what I did :

  1. Remove all defaults (cfAdd missing row_attr option to FormType #33688)

  2. About[TwigBridge] Add row_attr to all form themes #33573 (comment) -> Always add current attr values (like what we do for the label attr class). That means end users can easily add attr values but not remove them. That's consistent with the current codebase + better for DX. If end users wants to remove default classes, they just have to override the whole block like currently. Creating dedicated blocks as I suggested is possible but requires more code and is probably not needed. Removing default classes makes no sense anyway (since it probably break the display).

@fancywebfancywebforce-pushed thetwig-bridge-row-attr branch 2 times, most recently from9146363 to6ac53d7CompareSeptember 26, 2019 16:38
@loevgaard
Copy link
Contributor

What's the status with this PR? :)

@nicolas-grekas
Copy link
Member

Thank you@fancyweb.

nicolas-grekas added a commit that referenced this pull requestNov 28, 2019
This PR was merged into the 4.3 branch.Discussion----------[TwigBridge] Add row_attr to all form themes| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix#33552| License       | MIT| Doc PR        | -The rules I applied:- Always done on the first HTML tag of the row.- Current existing row attrs (`class` or `style`) are applied unless they are defined by the `row_attr` override. They can be removed if they are explicitly set to `false`.Starting from:```<div>```With `row_attr: {foo: "bar"}`:```<div foo="bar">```With `row_attr: {class: "ccc"}`:```<div>```With `row_attr: {foo: "bar", class: false}`:```<div foo="bar">```Commits-------dfdcbb4 [TwigBridge] Add row_attr to all form themes
@nicolas-grekasnicolas-grekas merged commitdfdcbb4 intosymfony:4.3Nov 28, 2019
@fancywebfancyweb deleted the twig-bridge-row-attr branchNovember 28, 2019 12:16
This was referencedDec 1, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

6 participants

@fancyweb@xabbuh@loevgaard@nicolas-grekas@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp