定制 zantknight/yii2-gallery4 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zantknight/yii2-gallery4

最新稳定版本:v1.1.1

Composer 安装命令:

composer require zantknight/yii2-gallery4

包简介

Gallery manager for bootstrap4

README 文档

README

Gallery manager for bootstrap4

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist zantknight/yii2-gallery4 "*"

or add

"zantknight/yii2-gallery4": "*"

to the require section of your composer.json file.

Usage

  1. Migrate to create gallery table by calling this command
    php yii migrate --migrationPath=@vendor/zantknight/yii2-gallery4/migrations
    
  2. Update config/web.php
    return [
        ...
        'modules' => [
            'gallery4' => [
                 'class' => 'zantknight\yii\gallery\Module',
             ],
        ]
    ]
  3. Add this behavior to your model
     ...
     use zantknight\yii\gallery\Gallery4Behavior;
    
     class YourModel extends \yii\db\ActiveRecord
     {
         ...
    
         public function behaviors()
         {
             return [
                 ...
                 [
                     'class' => Gallery4Behavior::className(),
                     'model' => $this
                 ]
             ];
         }
     }
  4. Put this onto your view
    <?= \zantknight\yii\gallery\Gallery4Widget::widget([
         'ownerModel' => $model,
         'multiple' => true
     ]); ?>
    Description
    • ownerModel Model class where is used by view
    • multiple Multiple upload status
  5. Put this chunk in params.php
     return [
         ...
         'bsVersion' => '4.x',
     ];
  6. Create folder "media" in your "web" folder
  7. You will get something like this alt text alt text alt text alt text
  8. For image administration, go to Module Gallery4 Url (/gallery4/admin) and you will get something like this alt text

统计信息

  • 总下载量: 445
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-14