File tree 1 file changed +3
-2
lines changed
reference/forms/types/options
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ better performance::
46
46
use App\StaticClass;
47
47
use Symfony\Component\Form\AbstractType;
48
48
use Symfony\Component\Form\ChoiceList\ChoiceList;
49
+ use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
49
50
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
50
51
use Symfony\Component\OptionsResolver\Options;
51
52
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -61,13 +62,13 @@ better performance::
61
62
{
62
63
$resolver->setDefaults([
63
64
// the example below will create a CallbackChoiceLoader from the callable
64
- 'choice_loader' => ChoiceList::lazy($this, function() {
65
+ 'choice_loader' => ChoiceList::lazy($this, function () {
65
66
return StaticClass::getConstants();
66
67
}),
67
68
68
69
// you can pass your own loader as well, depending on other options
69
70
'some_key' => null,
70
- 'choice_loader' => function (Options $options): array {
71
+ 'choice_loader' => function (Options $options): ChoiceLoaderInterface {
71
72
return ChoiceList::loader(
72
73
// pass the instance of the type or type extension which is
73
74
// currently configuring the choice list as first argument
You can’t perform that action at this time.
0 commit comments