项目作者: zacksleo

项目描述 :
yii2 gallery
高级语言: JavaScript
项目地址: git://github.com/zacksleo/yii2-gallery.git
创建时间: 2017-02-13T14:58:33Z
项目社区:https://github.com/zacksleo/yii2-gallery

开源协议:

下载


Yii2 gallery

Latest Stable Version
Total Downloads
License

original yii2-gallery-module

Features:

  • Upload image
  • Drag image and change position
  • Make gallery template
  • Use inline widget

gallery

Installation

Composer

The preferred way to install this extension is through Composer.

Either run php composer.phar require sadovojav/yii2-gallery-module "dev-master"

or add "sadovojav/yii2-gallery-module": "dev-master" to the require section of your composer.json

Migration

yii migrate —migrationPath=@vendor/sadovojav/yii2-gallery-module/migrations

Config

  1. Attach the module in your config file:
  1. 'modules' => [
  2. 'gallery' => [
  3. 'class' => 'sadovojav\gallery\Module',
  4. ],
  5. ],
  • string basePath = @webroot/galleries - Base path
  • integer queryCacheDuration = 86400 - Query cache duration
  • bool uniqueName = false - Generate unique name
  1. If you want use custom template, you can set path map
  1. 'view' => [
  2. 'theme' => [
  3. 'pathMap' => [
  4. '@sadovojav/gallery/widgets/views' => '@app/web/views/gallery'
  5. ],
  6. 'baseUrl' => '@web/web'
  7. ],
  8. ],

Administration

Galleries manager - /gallery/gallery/index

Using

1. Widget

  1. <?= \sadovojav\gallery\widgets\Gallery::widget([
  2. 'galleryId' => $model->galleryId
  3. ]); ?>
  • integer galleryId required - Gallery Id
  • bool caption = false - Show caption in default template
  • string template = null - Your custom widget template

2. Inline Widget

See here -> https://github.com/sadovojav/yii2-inline-widgets-behavior