Change label in boolean type filter

39 views
Skip to first unread message

olivier...@gmail.com

unread,
Dec 14, 2016, 6:06:14 AM12/14/16
to sonata-devs
Hi,
I have a datagrid filter (in configureDatagridFilters function)  with a field typed as boolean.

According to the doc,

The boolean type is a specialized ChoiceType, where the list of choices is locked to yes and no.

Note that for backward compatibility reasons, it will set your value to 1 for yes and to 2 for no. If you want to map to a boolean value, just set the option transform to true. For instance, you need to do so when mapping to a doctrine boolean.

my field  shows 1 or 2… I want it to show «yes» or «no» (with the default value), but the doc doesn't say HOW to set the option «transform» to true.

Any help will be MUUUUUUUUCH appreciated

Thanks
Reply all
Reply to author
Forward
0 new messages