Skip to content

Commit

Permalink
Fix according to PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
marekkalnik committed Jan 13, 2014
1 parent 94fe8dc commit 8231230
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions components/options_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,11 @@ There is also an
method, which you can use if you want to add an allowed value to the previously
set allowed values.

If you need to add some more logic to the value validation process you can pass a callable
.. versionadded:: 2.5

The callback support for allowed values was introduced in Symfony 2.5.

If you need to add some more logic to the value validation process, you can pass a callable
as an allowed value::

// ...
Expand All @@ -315,15 +319,14 @@ as an allowed value::

$resolver->setAllowedValues(array(
'transport' => function($value) {
return strpos($value, 'mail') !== false;
}
return false !== strpos($value, 'mail');
},
));
}

Note that using this together with addAllowedValues will not work.
.. caution::

.. versionadded:: 2.5
The callback support for allowed values was added in Symfony 2.5.
Note that using this together with ``addAllowedValues`` will not work.

Configure allowed Types
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 8231230

Please sign in to comment.