PHPackages                             dlds/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. dlds/yii2-gallery-manager

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

dlds/yii2-gallery-manager
=========================

Extension for yii, that allows to manage image galleries

2.1.3(8y ago)13.9k2[2 PRs](https://github.com/dlds/yii2-gallery-manager/pulls)MITPHP

Since Mar 31Pushed 8y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (22)Used By (0)

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

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

Yii2 port of

(frontend part mostly without changes, but backend was rewritten almost completely)

**warning: preview version**

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 dlds/yii2-gallery-manager "*@dev"`

or add

`"dlds/yii2-gallery-manager": "*@dev"`

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

Usage
-----

[](#usage)

Add migration to create table for images:

```
class m150318_154933_gallery_ext
    extends dlds\galleryManager\migrations\m140930_003227_gallery_manager
{

}
```

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

```
public function behaviors()
{
    return [
         'galleryBehavior' => [
             'class' => GalleryBehavior::className(),
             'type' => 'product',
             'extension' => 'jpg',
             'directory' => Yii::getAlias('@contentRoot') . '/images/product/gallery',
             'url' => Yii::getAlias('@web') . '/images/product/gallery',
             'versions' => [
                 'small' => function ($img) {
                     /** @var ImageInterface $img */
                     return $img
                         ->copy()
                         ->thumbnail(new Box(200, 200));
                 },
                 'medium' => function ($img) {
                     /** @var ImageInterface $img */
                     $dstSize = $img->getSize();
                     $maxWidth = 800;
                     if ($dstSize->getWidth() > $maxWidth) {
                         $dstSize = $dstSize->widen($maxWidth);
                     }
                     return $img
                         ->copy()
                         ->resize($dstSize);
                 },
             ]
         ]
    ];
}
```

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'
        ]
    );
}
```

Done!

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

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

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 71% 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 ~49 days

Recently: every ~106 days

Total

21

Last Release

3073d ago

Major Versions

0.3 → 1.02015-04-01

1.2.10 → 2.0.02016-10-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/23f0d05bb48111bd348c97af007c453b374ba03c36ec4fd114dfd73896bf5958?d=identicon)[dlds](/maintainers/dlds)

---

Top Contributors

[![jirisvoboda](https://avatars.githubusercontent.com/u/10264326?v=4)](https://github.com/jirisvoboda "jirisvoboda (22 commits)")[![zxbodya](https://avatars.githubusercontent.com/u/446117?v=4)](https://github.com/zxbodya "zxbodya (6 commits)")[![davidyew](https://avatars.githubusercontent.com/u/544229?v=4)](https://github.com/davidyew "davidyew (2 commits)")[![svobik7](https://avatars.githubusercontent.com/u/761766?v=4)](https://github.com/svobik7 "svobik7 (1 commits)")

---

Tags

imageyii2extensiongallery

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/dlds-yii2-gallery-manager/health.svg)](https://phpackages.com/packages/dlds-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)
