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