PHPackages                             aquy/yii2-gallery-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. aquy/yii2-gallery-manager

ActiveYii2-extension[Image &amp; Media](/categories/media)

aquy/yii2-gallery-manager
=========================

Extension for yii, that allows to manage image galleries

0.1.7(4y ago)01.6k↓100%2MITPHP

Since May 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/aquy/yii2-gallery-manager)[ Packagist](https://packagist.org/packages/aquy/yii2-gallery-manager)[ RSS](/packages/aquy-yii2-gallery-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (11)Used By (0)

Gallery Manager usage instructions
==================================

[](#gallery-manager-usage-instructions)

Fork of

Features
--------

[](#features)

1. AJAX image upload
2. Optional name and description for each image
3. Possibility to arrange images in gallery
4. Ability to generate few versions for each image with different configurations
5. Drag &amp; Drop

Decencies
---------

[](#decencies)

1. Yii2
2. Twitter bootstrap assets (version 3)
3. Imagine library
4. JQuery UI (included with Yii)

Installation:
-------------

[](#installation)

The preferred way to install this extension is through [composer](https://getcomposer.org/).

Either run

`php composer.phar require --prefer-dist aquy/yii2-gallery-manager "*"`

or add

`"aquy/yii2-gallery-manager": "*"`

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Add migration to create table for images:

```
class m150318_154933_gallery_ext
    extends aquy\gallery\migrations\m140930_003227_gallery_manager
{

}
```

Or better - copy migration to you application.

Add GalleryBehavior to your model, and configure it, create folder for uploaded files.

```
public function behaviors()
{
    return [
         'galleryBehavior' => [
             'class' => GalleryBehavior::className(),
             'type' => 'product',
             'directory' => Yii::getAlias('@webroot') . '/images/product/gallery',
             'url' => Yii::getAlias('@web') . '/images/product/gallery',
         ]
    ];
}
```

Add GalleryManagerAction in controller somewhere in your application. Also on this step you can add some security checks for this action.

```
public function actions()
{
    return [
       'galleryApi' => [
           'class' => GalleryManagerAction::className(),
           // mappings between type names and model classes (should be the same as in behaviour)
           'types' => [
               'product' => Product::className()
           ]
       ],
    ];
}
```

Add ImageAttachmentWidget somewhere in you application, for example in editing from.

```
if ($model->isNewRecord) {
    echo 'Can not upload images for new record';
} else {
    echo GalleryManager::widget(
        [
            'model' => $model,
            'behaviorName' => 'galleryBehavior',
            'apiRoute' => 'product/galleryApi',
            'async' => false
        ]
    );
}
```

Done!

Now, you can use uploaded images from gallery like following:

```
foreach($model->getBehavior('galleryBehavior')->getImages() as $image) {
    echo Html::img($image->getUrl());
}
```

or

```
$image = $model->getBehavior('galleryBehavior')->getImage()
echo Html::img($image->getUrl());
```

Options
-------

[](#options)

### Using non default table name for gallery images(default is `{{%gallery_image}}`):

[](#using-non-default-table-name-for-gallery-imagesdefault-is-gallery_image)

1. Add migration that will create table you need
2. Change `tableName` property in behavior configuration

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~227 days

Recently: every ~322 days

Total

10

Last Release

1597d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/72ac986b83b567f214f68d2bb68e6225b4c2723e01bb2ce94f3bc0184a4c9fdd?d=identicon)[aquy](/maintainers/aquy)

---

Top Contributors

[![zxbodya](https://avatars.githubusercontent.com/u/446117?v=4)](https://github.com/zxbodya "zxbodya (18 commits)")[![aquy](https://avatars.githubusercontent.com/u/4364368?v=4)](https://github.com/aquy "aquy (8 commits)")[![KarPaLex98](https://avatars.githubusercontent.com/u/33882300?v=4)](https://github.com/KarPaLex98 "KarPaLex98 (5 commits)")[![and800](https://avatars.githubusercontent.com/u/9919211?v=4)](https://github.com/and800 "and800 (1 commits)")[![stupidusername](https://avatars.githubusercontent.com/u/3828886?v=4)](https://github.com/stupidusername "stupidusername (1 commits)")[![garando](https://avatars.githubusercontent.com/u/7852028?v=4)](https://github.com/garando "garando (1 commits)")[![davidyew](https://avatars.githubusercontent.com/u/544229?v=4)](https://github.com/davidyew "davidyew (1 commits)")[![EkaterinaBuyakova](https://avatars.githubusercontent.com/u/12337260?v=4)](https://github.com/EkaterinaBuyakova "EkaterinaBuyakova (1 commits)")

---

Tags

imageyii2extensiongallery

### Embed Badge

![Health badge](/badges/aquy-yii2-gallery-manager/health.svg)

```
[![Health](https://phpackages.com/badges/aquy-yii2-gallery-manager/health.svg)](https://phpackages.com/packages/aquy-yii2-gallery-manager)
```

###  Alternatives

[yurkinx/yii2-image

Yii2 extension for image manipulating using Kohana Image Library.

66412.9k9](/packages/yurkinx-yii2-image)[noam148/yii2-image-resize

A Yii2 component for resizing images (on the fly)

1144.6k7](/packages/noam148-yii2-image-resize)[raoul2000/yii2-jcrop-widget

This extension is a wrapper for the jQuery Image Cropping Plugin (jcrop)

10248.3k2](/packages/raoul2000-yii2-jcrop-widget)[maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

1020.8k](/packages/maxmirazh33-yii2-uploadable-cropable-image)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
