@@ -76,21 +76,21 @@ method::
76
76
// a callback to return the label for a given choice
77
77
// if a placeholder is used, its empty value (null) may be passed but
78
78
// its label is defined by its own "placeholder" option
79
- 'choice_label' => function(?Category $category) {
79
+ 'choice_label' => function (?Category $category) {
80
80
return $category ? strtoupper($category->getName()) : '';
81
81
},
82
82
// returns the html attributes for each option input (may be radio/checkbox)
83
- 'choice_attr' => function(?Category $category) {
83
+ 'choice_attr' => function (?Category $category) {
84
84
return $category ? ['class' => 'category_'.strtolower($category->getName())] : [];
85
85
},
86
86
// every option can use a string property path or any callable that get
87
87
// passed each choice as argument, but it may not be needed
88
- 'group_by' => function() {
88
+ 'group_by' => function () {
89
89
// randomly assign things into 2 groups
90
90
return rand(0, 1) == 1 ? 'Group A' : 'Group B';
91
91
},
92
92
// a callback to return whether a category is preferred
93
- 'preferred_choices' => function(?Category $category) {
93
+ 'preferred_choices' => function (?Category $category) {
94
94
return $category && 100 < $category->getArticleCounts();
95
95
},
96
96
]);
@@ -314,5 +314,5 @@ Field Variables
314
314
315
315
.. tip ::
316
316
317
- It's significantly faster to use the :ref: `form-twig-selectedchoice `
317
+ It's significantly faster to use the :ref: `selectedchoice < form-twig-selectedchoice > `
318
318
test instead when using Twig.
0 commit comments