File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Top Open diff view settings Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Top Open diff view settings Original file line number Diff line number Diff line change @@ -305,7 +305,11 @@ There is also an
305305method, which you can use if you want to add an allowed value to the previously
306306set allowed values.
307307
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
309313as an allowed value::
310314
311315 // ...
@@ -315,15 +319,14 @@ as an allowed value::
315319
316320 $resolver->setAllowedValues(array(
317321 'transport' => function($value) {
318- return strpos($value, 'mail') !== false ;
319- }
322+ return false !== strpos($value, 'mail');
323+ },
320324 ));
321325 }
322326
323- Note that using this together with addAllowedValues will not work.
327+ .. caution ::
324328
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.
327330
328331Configure allowed Types
329332~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments