File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,11 @@ There is also an
305
305
method, which you can use if you want to add an allowed value to the previously
306
306
set allowed values.
307
307
308
- If you need to add some more logic to the value validation process you can pass a callable
308
+ .. versionadded :: 2.5
309
+
310
+ The callback support for allowed values was introduced in Symfony 2.5.
311
+
312
+ If you need to add some more logic to the value validation process, you can pass a callable
309
313
as an allowed value::
310
314
311
315
// ...
@@ -315,15 +319,14 @@ as an allowed value::
315
319
316
320
$resolver->setAllowedValues(array(
317
321
'transport' => function($value) {
318
- return strpos($value, 'mail') !== false ;
319
- }
322
+ return false !== strpos($value, 'mail');
323
+ },
320
324
));
321
325
}
322
326
323
- Note that using this together with addAllowedValues will not work.
327
+ .. caution ::
324
328
325
- .. versionadded :: 2.5
326
- The callback support for allowed values was added in Symfony 2.5.
329
+ Note that using this together with ``addAllowedValues `` will not work.
327
330
328
331
Configure allowed Types
329
332
~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments