zantknight / yii2-gallery4
Gallery manager for bootstrap4
Installs: 414
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 1
Type:yii2-extension
Requires
- kartik-v/yii2-widget-fileinput: @dev
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-bootstrap4: ~2.0.6
This package is auto-updated.
Last update: 2025-04-22 08:39:39 UTC
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
- Migrate to create gallery table by calling this command
php yii migrate --migrationPath=@vendor/zantknight/yii2-gallery4/migrations
- Update config/web.php
return [ ... 'modules' => [ 'gallery4' => [ 'class' => 'zantknight\yii\gallery\Module', ], ] ]
- 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 ] ]; } }
- 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
- Put this chunk in params.php
return [ ... 'bsVersion' => '4.x', ];
- Create folder "media" in your "web" folder
- You will get something like this
- For image administration, go to Module Gallery4 Url (/gallery4/admin) and you will get something like this