File tree Expand file tree Collapse file tree 6 files changed +25
-0
lines changed
Filter options
Expand file tree Collapse file tree 6 files changed +25
-0
lines changed
Original file line number Diff line number Diff line change @@ -339,6 +339,10 @@ the ``genders`` parameter value as the first argument to its to-be-created
339
339
Make sure the services file is being imported. See :ref: `service-container-imports-directive `
340
340
for details.
341
341
342
+ .. versionadded :: 3.3
343
+ Prior to Symfony 3.3, you needed to define form type services as ``public ``.
344
+ Starting from Symfony 3.3, you can also define them as ``private ``.
345
+
342
346
First, add a ``__construct `` method to ``GenderType ``, which receives the gender
343
347
configuration::
344
348
Original file line number Diff line number Diff line change @@ -131,6 +131,10 @@ The ``extended_type`` key of the tag is the type of field that this extension sh
131
131
be applied to. In your case, as you want to extend the ``Symfony\Component\Form\Extension\Core\Type\FileType ``
132
132
field type, you will use that as the ``extended_type ``.
133
133
134
+ .. versionadded :: 3.3
135
+ Prior to Symfony 3.3, you needed to define type extension services as ``public ``.
136
+ Starting from Symfony 3.3, you can also define them as ``private ``.
137
+
134
138
.. tip ::
135
139
136
140
There is an optional tag attribute called ``priority ``, which
Original file line number Diff line number Diff line change @@ -334,11 +334,16 @@ Define the form type as a service in your configuration files.
334
334
)
335
335
->addTag('form.type')
336
336
;
337
+
337
338
.. tip ::
338
339
339
340
For more information about defining form types as services, read
340
341
:doc: `register your form type as a service </form/form_dependencies >`.
341
342
343
+ .. versionadded :: 3.3
344
+ Prior to Symfony 3.3, you needed to define form type services as ``public ``.
345
+ Starting from Symfony 3.3, you can also define them as ``private ``.
346
+
342
347
Now, you can easily use your ``TaskType ``::
343
348
344
349
// e.g. in a controller somewhere
Original file line number Diff line number Diff line change @@ -370,6 +370,10 @@ you need to register it as a service and tag it with :ref:`form.type <dic-tags-f
370
370
371
371
$container->setDefinition('app.form.friend_message', $definition);
372
372
373
+ .. versionadded :: 3.3
374
+ Prior to Symfony 3.3, you needed to define form type services as ``public ``.
375
+ Starting from Symfony 3.3, you can also define them as ``private ``.
376
+
373
377
In a controller that extends the :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Controller\\ Controller `
374
378
class, you can simply call::
375
379
Original file line number Diff line number Diff line change @@ -136,6 +136,10 @@ Next, register this as a service and tag it with ``form.type``:
136
136
->addTag('form.type')
137
137
;
138
138
139
+ .. versionadded :: 3.3
140
+ Prior to Symfony 3.3, you needed to define form type services as ``public ``.
141
+ Starting from Symfony 3.3, you can also define them as ``private ``.
142
+
139
143
That's it! Your controller - where you create the form - doesn't need to change
140
144
at all: Symfony is smart enough to load the ``TaskType `` from the container.
141
145
Original file line number Diff line number Diff line change @@ -217,6 +217,10 @@ creating a service and tagging it as ``form.type_guesser``:
217
217
->addTag('form.type_guesser')
218
218
;
219
219
220
+ .. versionadded :: 3.3
221
+ Prior to Symfony 3.3, you needed to define type guesser services as ``public ``.
222
+ Starting from Symfony 3.3, you can also define them as ``private ``.
223
+
220
224
.. sidebar :: Registering a Type Guesser in the Component
221
225
222
226
If you're using the Form component standalone in your PHP project, use
You can’t perform that action at this time.
0 commit comments