File tree Expand file tree Collapse file tree 1 file changed +36
-2
lines changed Expand file tree Collapse file tree 1 file changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -212,8 +212,42 @@ Configuration
212
212
-------------
213
213
214
214
Before using the Symfony validator, make sure it's enabled in the main config
215
- file. Besides, if you plan to use annotations to configure validation, make sure
216
- that the ``enable_annotations `` option is ``true ``:
215
+ file:
216
+
217
+ .. configuration-block ::
218
+
219
+ .. code-block :: yaml
220
+
221
+ # app/config/config.yml
222
+ framework :
223
+ validation : { enabled: true }
224
+
225
+ .. code-block :: xml
226
+
227
+ <!-- app/config/config.xml -->
228
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
229
+ <container xmlns =" http://symfony.com/schema/dic/services"
230
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
231
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
232
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
233
+ http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
234
+
235
+ <framework : config >
236
+ <framework : validation enabled =" true" />
237
+ </framework : config >
238
+ </container >
239
+
240
+ .. code-block :: php
241
+
242
+ // app/config/config.php
243
+ $container->loadFromExtension('framework', array(
244
+ 'validation' => array(
245
+ 'enabled' => true,
246
+ ),
247
+ ));
248
+
249
+ Besides, if you plan to use annotations to configure validation, replace the
250
+ previous configuration by the following:
217
251
218
252
.. configuration-block ::
219
253
You can’t perform that action at this time.
0 commit comments