diff --git a/Controller/BaseController.php b/Controller/BaseController.php index b6244da..cb8dce1 100644 --- a/Controller/BaseController.php +++ b/Controller/BaseController.php @@ -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;