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

Commita6d4c40

Browse files
committed
[Form] Document using TranslatableMessage in form help
1 parent765a6e0 commita6d4c40

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed
Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
help
22
~~~~
33

4-
**type**: ``string`` **default**: null
4+
**type**: ``string``or ``TranslatableMessage``**default**: null
55

66
Allows you to define a help message for the form field, which by default is
77
rendered below the field::
88

9-
$builder->add('zipCode', null, [
10-
'help' =>'The ZIP/Postal code for your credit card\'s billing address.',
11-
]);
9+
use Symfony\Component\Translation\TranslatableMessage;
10+
11+
$builder
12+
->add('zipCode', null, [
13+
'help' => 'The ZIP/Postal code for your credit card\'s billing address.',
14+
])
15+
16+
// ...
17+
18+
->add('status', null, [
19+
'help' => new TranslatableMessage('order.status', ['%order_id%' => $order->getId()], 'store'),
20+
])
21+
;
22+
23+
.. versionadded:: 5.4
24+
25+
Support for passing ``TranslatableMessage`` objects was introduced in Symfony 5.4.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp