Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #30320 [Form][TwigBridge] Add row_attr to form theme (alexand…
…er-schranz) This PR was squashed before being merged into the 4.3-dev branch (closes #30320). Discussion ---------- [Form][TwigBridge] Add row_attr to form theme | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | waiting for confirmation to implement | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Currently you need to copy the whole form_row block if you just want to add a class to the form_row div. Instead we could introduce a `row_attr` which can then simple be set the following in the theme e.g.: ```twig {% block form_row %} {% set row_attr = { class: 'form__field' } %} {{ parent() }} {% endblock %} ``` or in php: ``` $builder->add('test', TextType::class, ['row_attr' => ['class' => 'form__field']]); ``` Commits ------- 7ab1b00 [Form][TwigBridge] Add row_attr to form theme
- Loading branch information