问题
I've been trying to do something relatively simple but that does not work.
I want to be able to collapse groups in sonata to enhance the user's experience.
->with('MyGroup', array('collapsed' => true))
-add('MyField')
->end();
This is based on the Sonata documentation.
Pretty simple but i can't see why it does not work. Does array('collapsed' => true) is not enough?
Is it an issue?
回答1:
The collapsed option seems to have been removed in the latest version of Sonata :
in 2.1 it is available https://github.com/sonata-project/SonataAdminBundle/blob/2.1/Resources/views/CRUD/base_edit_form.html.twig#L21
in 2.2 and latest it is not, there is only one reference of collapsed in the file, which is for a css class. https://github.com/sonata-project/SonataAdminBundle/blob/2.2/Resources/views/CRUD/base_edit_form.html.twig#L41
Changelog 2.2 : https://github.com/sonata-project/SonataAdminBundle/blob/master/UPGRADE-2.2.md
来源:https://stackoverflow.com/questions/29105087/symfony2-sonata-collapsed-group