Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 240cf46 commit 4593bafCopy full SHA for 4593baf
cookbook/bundles/override.rst
@@ -45,7 +45,19 @@ In progress...
45
Forms
46
-----
47
48
-In progress...
+In order to override a form type, it has to be registered as a service (meaning
49
+it is tagged as "form.type"). You can then override it as you would override any
50
+service as explained in "Services & Configuration". This, of course, will only
51
+work if the type is referred to by its alias rather than being instantiated,
52
+e.g.:
53
+
54
+.. code-block:: php
55
+ $builder->add('name', 'custom_type');
56
57
+rather than
58
59
60
+ $builder->add('name', new CustomType());
61
62
Validation metadata
63
-------------------
0 commit comments