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

[Form] Document using TranslatableMessage in form Fields#19246

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
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionreference/forms/types/options/button_label.rst.inc
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
``label``
~~~~~~~~~

**type**: ``string`` **default**: The label is "guessed" from the field name
**type**: ``string``or ``TranslatableMessage``**default**: The label is "guessed" from the field name

Sets the label that will be displayed on the button. The label can also
be directly set inside the template:
Expand Down
5 changes: 4 additions & 1 deletionreference/forms/types/options/placeholder.rst.inc
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
``placeholder``
~~~~~~~~~~~~~~~

**type**: ``string`` or ``boolean``
**type**: ``string`` or ``TranslatableMessage`` or ``boolean``

This option determines whether or not a special "empty" option (e.g. "Choose
an option") will appear at the top of a select widget. This option only
Expand All@@ -14,6 +14,9 @@ applies if the ``multiple`` option is set to false.

$builder->add('states', ChoiceType::class, [
'placeholder' => 'Choose an option',

// or if you want to translate the text
'placeholder' => new TranslatableMessage('form.placeholder.select_option', [], 'form'),
]);

* Guarantee that no "empty" value option is displayed::
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp