https://github.com/zacksleo/yii2-gallery
yii2 gallery
https://github.com/zacksleo/yii2-gallery
yii2 yii2-extension yii2-gallery
Last synced: 4 months ago
JSON representation
yii2 gallery
- Host: GitHub
- URL: https://github.com/zacksleo/yii2-gallery
- Owner: zacksleo
- Created: 2017-02-13T14:58:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-06-30T06:04:15.000Z (almost 7 years ago)
- Last Synced: 2025-01-31T20:55:52.435Z (over 1 year ago)
- Topics: yii2, yii2-extension, yii2-gallery
- Language: JavaScript
- Size: 633 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Yii2 gallery
[](https://packagist.org/packages/zacksleo/yii2-gallery)
[](https://packagist.org/packages/zacksleo/yii2-gallery)
[](https://packagist.org/packages/zacksleo/yii2-gallery)
original [yii2-gallery-module](https://github.com/sadovojav/yii2-gallery-module)
#### 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](http://getcomposer.org/).
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:
```php
'modules' => [
'gallery' => [
'class' => 'sadovojav\gallery\Module',
],
],
```
- string `basePath` = `@webroot/galleries` - Base path
- integer `queryCacheDuration` = `86400` - Query cache duration
- bool `uniqueName` = `false` - Generate unique name
2. If you want use custom template, you can set path map
```php
'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](https://github.com/sadovojav/yii2-inline-widgets-behavior)