funcphp/easyadmin-gallery

该包最新版本(dev-master)没有可用的许可证信息。

为 EasyAdminBundle 提供马赛克列表、拖放上传等功能

该包的官方仓库似乎已不存在,因此该包已被冻结。

安装: 472

依赖: 0

建议: 0

安全: 0

星标: 11

关注者: 1

分支: 4

公开问题: 1

语言:HTML

dev-master 2018-05-09 20:40 UTC

This package is not auto-updated.

Last update: 2019-04-12 22:56:27 UTC


README

为 EasyAdminBundle 提供马赛克列表、拖放上传等功能

Demo

  • 马赛克/砖石式列表
  • 拖放文件上传并创建记录

安装

通过 Composer 下载仓库

composer require funcphp/easyadmin-gallery "dev-master"

app/AppKernel.php 启用包

    $bundles = [
        ...
        new Func\EasyAdminGalleryBundle\FuncEasyAdminGalleryBundle(),
        ...
    ];

安装资源

php bin/console assets:install --symlink

使用方法

1.

将您的画廊实体控制器设置为 Func\EasyAdminGalleryBundle\Controller\GalleryController

或者

在您的 画廊管理员控制器 中使用此特性: Func\EasyAdminGalleryBundle\Controller\Traits\ListMosaic

2.1. 马赛克视图

easy_admin:
    entities:
        Gallery:
            class: AppBundle\Entity\Gallery # an entity
            controller: Func\EasyAdminGalleryBundle\Controller\GalleryController
            list:
                fields:
                    
                    # thumbnail field
                    -
                        property: 'image'
                        type: 'image'
                        base_path: '%path.gallery%'
                        thumbnail: true ##
                    
                    # thumbnail text field
                    -
                        property: 'title'
                        thumbnail_text: true ##
                    
                    # other fields
                    - 'id'
                    - 'enabled'
                    
                    ...
                ...
            ...
        ...
    ...
...

准备好马赛克列表。

2.2. 拖放上传

将您的画廊实体控制器设置为 Func\EasyAdminGalleryBundle\Controller\GalleryController

或者

在您的 画廊管理员控制器 中使用此特性: Func\EasyAdminGalleryBundle\Controller\Traits\DragDrop

easy_admin:
    entities:
        Gallery:
            class: AppBundle\Entity\Gallery # an entity
            controller: Func\EasyAdminGalleryBundle\Controller\GalleryController
            dragDrop:
            
                #backend values
                values:
                   #column: "value"
                    imageFile: "%%file%%"
                    title: "%%file.name%%"
                    enabled: true
                    description: "This record created by drag'n drop!"
                    
                #frontend values
                fields:
                   #form fields to overwrite values
                    - 'enabled'
                    - 'description'
                    
            list:
                fields:
                    ...
            form:
                fields:
                    ...
                ...
            ...
        ...
    ...
...

准备好拖放上传。

待办事项列表

  • 自定义列表操作:马赛克/砖石式列表
  • 自定义列表操作:拖放文件上传并创建记录
  • 自定义显示操作:画廊查看 - 上一个/当前/下一个
  • 自定义编辑操作:拖放