Allow for callable choice argument
This commit is contained in:
parent
03b561ab1d
commit
8bcd3af68a
@ -74,7 +74,11 @@ abstract class BaseController extends AbstractController
|
||||
$options = [];
|
||||
switch ($type) {
|
||||
case ChoiceType::class:
|
||||
$options['choices'] = $config['choices'];
|
||||
if (is_callable($config['choices'])) {
|
||||
$options['choices'] = $config['choices']();
|
||||
} else {
|
||||
$options['choices'] = $config['choices'];
|
||||
}
|
||||
break;
|
||||
case CheckboxType::class:
|
||||
$options['required'] = false;
|
||||
|
Loading…
Reference in New Issue
Block a user