-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…elementaire) This PR was merged into the 6.3 branch. Discussion ---------- [Form] Add a `placeholder_attr` option to `ChoiceType` PR symfony/symfony#48343 Commits ------- 8fcd394 Add a placeholder_attr option to ChoiceType
- Loading branch information
Showing
9 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
``placeholder_attr`` | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
**type**: ``array`` **default**: ``[]`` | ||
|
||
Use this to add additional HTML attributes to the placeholder choice:: | ||
|
||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
// ... | ||
|
||
$builder->add('fruits', ChoiceType::class, [ | ||
// ... | ||
'placeholder' => '...', | ||
'placeholder_attr' => [ | ||
['title' => 'Choose an option'], | ||
], | ||
]); | ||
|
||
.. versionadded:: 6.3 | ||
|
||
The ``placeholder_attr`` option was introduced in Symfony 6.3. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters