Issue
I am working with SonataAdminBundle in a symfony2 project in which my admin class is as given below :
class ApartmentsAdmin extends Admin
{
protected function configureFormFields(FormMapper $formMapper)
{
->add('images', 'collection', array(
'type' => new ImageType(),
'allow_add' => true,
'allow_delete' => true,
'by_reference' => true,
'mapped' => true,
'label' => false,
'required' => false,
'label' => 'Apartment Images'
));
}
}
It works fine ; but my issue is that , on edit page i want to let see preview of each images included in collection of images. In documentation of "SonataAdminBundle" image preview is given for one individual image , but how is it possible to make preview for collection images ..
Please suggest me..
Thanks a lot ..
Solution
Finally i am able to do this through "custom Form Type Extension" for which documentation is given on the link "http://symfony.com/doc/current/cookbook/form/create_form_type_extension.html" .
Answered By - Ajeet Varma Answer Checked By - Pedro (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.