File tree Expand file tree Collapse file tree 8 files changed +29
-35
lines changed Expand file tree Collapse file tree 8 files changed +29
-35
lines changed Original file line number Diff line number Diff line change @@ -289,9 +289,9 @@ field without having to :doc:`create a custom form type </form/create_custom_fie
289
289
290
290
public function buildForm(FormBuilderInterface $builder, array $options)
291
291
{
292
- $builder->add('name', TextType::class, array(
292
+ $builder->add('name', TextType::class, [
293
293
'block_prefix' => 'wrapped_text',
294
- ) );
294
+ ] );
295
295
}
296
296
297
297
.. versionadded :: 4.3
Original file line number Diff line number Diff line change @@ -78,9 +78,9 @@ The ``Json`` constraint can be applied to a property or a "getter" method:
78
78
79
79
public static function loadValidatorMetadata(ClassMetadata $metadata)
80
80
{
81
- $metadata->addPropertyConstraint('chapters', new Assert\Json(array(
81
+ $metadata->addPropertyConstraint('chapters', new Assert\Json([
82
82
'message' => 'You\'ve entered an invalid Json.',
83
- ) ));
83
+ ] ));
84
84
}
85
85
}
86
86
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ Given this translation message:
71
71
72
72
.. code-block :: yaml
73
73
74
- # translations/messages.en.yml
74
+ # translations/messages.en.yaml
75
75
form.order.submit_to_company : ' Send an order to %company%'
76
76
77
77
You can specify the placeholder values as follows::
Original file line number Diff line number Diff line change @@ -16,23 +16,21 @@ Given this translation message:
16
16
17
17
.. code-block:: yaml
18
18
19
- # translations/messages.en.yml
19
+ # translations/messages.en.yaml
20
20
form.order.id.placeholder: 'Enter unique identifier of the order to %company%'
21
21
form.order.id.title: 'This will be the reference in communications with %company%'
22
22
23
23
You can specify the placeholder values as follows::
24
24
25
- .. code-block:: php
26
-
27
- $builder->add('id', null, array(
28
- 'attr' => array(
25
+ $builder->add('id', null, [
26
+ 'attr' => [
29
27
'placeholder' => 'form.order.id.placeholder',
30
28
'title' => 'form.order.id.title',
31
- ) ,
29
+ ] ,
32
30
'attr_translation_parameters' => [
33
- '%company%' => 'ACME Inc.'
31
+ '%company%' => 'ACME Inc.',
34
32
]
35
- ) );
33
+ ] );
36
34
37
35
The ``attr_translation_parameters`` option of children fields is merged with the
38
36
same option of their parents, so children can reuse and/or override any of the
Original file line number Diff line number Diff line change @@ -15,19 +15,17 @@ Given this translation message:
15
15
16
16
.. code-block:: yaml
17
17
18
- # translations/messages.en.yml
18
+ # translations/messages.en.yaml
19
19
form.order.id.help: 'This will be the reference in communications with %company%'
20
20
21
21
You can specify the placeholder values as follows::
22
22
23
- .. code-block:: php
24
-
25
- $builder->add('id', null, array(
23
+ $builder->add('id', null, [
26
24
'help' => 'form.order.id.help',
27
25
'help_translation_parameters' => [
28
- '%company%' => 'ACME Inc.'
26
+ '%company%' => 'ACME Inc.',
29
27
]
30
- ) );
28
+ ] );
31
29
32
30
The ``help_translation_parameters`` option of children fields is merged with the
33
31
same option of their parents, so children can reuse and/or override any of the
Original file line number Diff line number Diff line change @@ -15,19 +15,17 @@ Given this translation message:
15
15
16
16
.. code-block:: yaml
17
17
18
- # translations/messages.en.yml
18
+ # translations/messages.en.yaml
19
19
form.order.id: 'Identifier of the order to %company%'
20
20
21
21
You can specify the placeholder values as follows::
22
22
23
- .. code-block:: php
24
-
25
- $builder->add('id', null, array(
23
+ $builder->add('id', null, [
26
24
'label' => 'form.order.id',
27
25
'label_translation_parameters' => [
28
- '%company%' => 'ACME Inc.'
26
+ '%company%' => 'ACME Inc.',
29
27
]
30
- ) );
28
+ ] );
31
29
32
30
The ``label_translation_parameters`` option of children fields is merged with
33
31
the same option of their parents, so children can reuse and/or override any of
Original file line number Diff line number Diff line change @@ -61,20 +61,20 @@ Given this translation message:
61
61
62
62
.. code-block :: yaml
63
63
64
- # translations/messages.en.yml
64
+ # translations/messages.en.yaml
65
65
form.order.reset : ' Reset an order to %company%'
66
66
67
67
You can specify the placeholder values as follows::
68
68
69
69
use Symfony\Component\Form\Extension\Core\Type\ResetType;
70
70
// ...
71
71
72
- $builder->add('send', ResetType::class, array(
72
+ $builder->add('send', ResetType::class, [
73
73
'label' => 'form.order.reset',
74
- 'label_translation_parameters' => array(
74
+ 'label_translation_parameters' => [
75
75
'%company%' => 'ACME Inc.',
76
- ) ,
77
- ) );
76
+ ] ,
77
+ ] );
78
78
79
79
The ``label_translation_parameters `` option of buttons is merged with the same
80
80
option of its parents, so buttons can reuse and/or override any of the parent
Original file line number Diff line number Diff line change @@ -74,20 +74,20 @@ Given this translation message:
74
74
75
75
.. code-block :: yaml
76
76
77
- # translations/messages.en.yml
77
+ # translations/messages.en.yaml
78
78
form.order.submit_to_company : ' Send an order to %company%'
79
79
80
80
You can specify the placeholder values as follows::
81
81
82
82
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
83
83
// ...
84
84
85
- $builder->add('send', SubmitType::class, array(
85
+ $builder->add('send', SubmitType::class, [
86
86
'label' => 'form.order.submit_to_company',
87
- 'label_translation_parameters' => array(
87
+ 'label_translation_parameters' => [
88
88
'%company%' => 'ACME Inc.',
89
- ) ,
90
- ) );
89
+ ] ,
90
+ ] );
91
91
92
92
The ``label_translation_parameters `` option of buttons is merged with the same
93
93
option of its parents, so buttons can reuse and/or override any of the parent
You can’t perform that action at this time.
0 commit comments