Last active
April 6, 2018 13:15
-
-
Save livsi/9cd7629ba2ea3670f86ec2fc0f4614e9 to your computer and use it in GitHub Desktop.
sonata date range field and fixed choice list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| .... | |
| protected function configureDatagridFilters(DatagridMapper $datagridMapper) | |
| { | |
| $keys = [1,2,3]; | |
| $choiceOptions = array_combine(keys, keys); | |
| $datagridMapper | |
| ->add('fooType', null, ['show_filter' => true], 'choice', ['choices' => $choiceOptions]) | |
| ->add('bazType', 'doctrine_orm_date_range', array( | |
| 'label' => 'Date', | |
| 'field_type' => 'sonata_type_date_range_picker', | |
| 'show_filter' => true, | |
| 'field_options' => [ | |
| 'field_options' => [ | |
| 'format' => 'yyyy-MM-dd', | |
| ], | |
| ] | |
| ) | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment