File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,12 @@ choice_label
110
110
The ``choice_label `` option was introduced in Symfony 2.7. Prior to Symfony
111
111
2.7, it was called ``property `` (which has the same functionality).
112
112
113
- **type **: ``string ``
113
+ **type **: ``string `` or a Closure
114
114
115
115
This is the property that should be used for displaying the entities
116
116
as text in the HTML element. If left blank, the entity object will be
117
- cast into a string and so must have a ``__toString() `` method.
117
+ cast into a string and so must have a ``__toString() `` method. If using Closure, it should
118
+ take a single argument, which is the entity and return the label of this entity.
118
119
119
120
.. note ::
120
121
@@ -152,7 +153,7 @@ instead of the default entity manager.
152
153
group_by
153
154
~~~~~~~~
154
155
155
- **type **: ``string ``
156
+ **type **: ``string `` or a Closure
156
157
157
158
This is a property path (e.g. ``author.name ``) used to organize the
158
159
available choices in groups. It only works when rendered as a select tag
You can’t perform that action at this time.
0 commit comments