sadovojav / yii2-gallery-module
Yii2 gallery module
Installs: 640
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 4
Forks: 7
Open Issues: 3
Language:JavaScript
Type:yii2-extension
Requires
- php: >=5.4.0
- kartik-v/yii2-grid: *
- kartik-v/yii2-widgets: *
- sadovojav/yii2-inline-widgets-behavior: dev-master
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-10-29 04:04:04 UTC
README
Features:
- Upload image
- Drag image and change position
- Make gallery template
- Use inline widget
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
- Attach the module in your config file:
'modules' => [ 'gallery' => [ 'class' => 'sadovojav\gallery\Module', ], ],
- string
basePath
=@webroot/galleries
- Base path - integer
queryCacheDuration
=86400
- Query cache duration - bool
uniqueName
=false
- Generate unique name
- If you want use custom template, you can set path map
'view' => [ 'theme' => [ 'pathMap' => [ '@sadovojav/gallery/widgets/views' => '@app/web/views/gallery' ], 'baseUrl' => '@web/web' ], ],
Administration
Galleries manager - /gallery/gallery/index
Using
1. Widget
<?= \sadovojav\gallery\widgets\Gallery::widget([
'galleryId' => $model->galleryId
]); ?>
- 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