【问题标题】:How to get image preview in symfony collection images如何在 symfony 集合图像中获得图像预览
【发布时间】:2014-08-21 16:46:57
【问题描述】:

我正在一个 symfony2 项目中使用 SonataAdminBundle,我的管理类如下所示:

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'
              ));
           }
       }

它工作正常;但我的问题是,在编辑页面上,我想让查看图像集合中包含的每个图像的预览。在“SonataAdminBundle”的文档中,为一个单独的图像提供了图像预览,但是如何对集合图像进行预览..

请给我建议..

非常感谢..

【问题讨论】:

    标签: jquery html doctrine-orm symfony-2.3 php-5.4


    【解决方案1】:

    最后我可以通过“自定义表单类型扩展”来做到这一点,链接“http://symfony.com/doc/current/cookbook/form/create_form_type_extension.html”上给出了文档。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-07
      相关资源
      最近更新 更多