Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form][TwigBridge] Add row_attr to all form themes #33552

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

Closed
javiereguiluz opened this issue Sep 11, 2019 · 0 comments
Closed

[Form][TwigBridge] Add row_attr to all form themes #33552

javiereguiluz opened this issue Sep 11, 2019 · 0 comments

Comments

@javiereguiluz
Copy link
Member

Symfony version(s) affected: 4.3+

Description
In #30320 we added the row_attr option ... but only for the form_div_layout.html.twig theme.

We should add it too to all the other built-in themes: https://github.com/symfony/symfony/tree/4.3/src/Symfony/Bridge/Twig/Resources/views/Form

@javiereguiluz javiereguiluz added this to the 4.3 milestone Sep 11, 2019
nicolas-grekas added a commit that referenced this issue Nov 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 class="form-group">
```

With `row_attr: {foo: "bar"}`:
```
<div foo="bar" class="form-group">
```

With `row_attr: {class: "ccc"}`:
```
<div class="ccc">
```

With `row_attr: {foo: "bar", class: false}`:
```
<div foo="bar">
```

Commits
-------

dfdcbb4 [TwigBridge] Add row_attr to all form themes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants