PHPackages                             resmedia/yii2-mongo-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. [Database &amp; ORM](/categories/database)
4. /
5. resmedia/yii2-mongo-gallery-manager

ActiveYii2-extension[Database &amp; ORM](/categories/database)

resmedia/yii2-mongo-gallery-manager
===================================

Extension for yii2 with mongodb, that allows to manage image galleries

1.1.0(5y ago)1155MITPHP

Since Feb 13Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Resmedia/yii2-mongo-gallery-manager)[ Packagist](https://packagist.org/packages/resmedia/yii2-mongo-gallery-manager)[ RSS](/packages/resmedia-yii2-mongo-gallery-manager/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Yii2 Gallery Manager for MongoDB
================================

[](#yii2-gallery-manager-for-mongodb)

#### This is rebuild of

[](#this-is-rebuild-of-httpsgithubcomzxbodyayii-gallery-manager)

Features
--------

[](#features)

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

Decencies
---------

[](#decencies)

Yii2 Twitter bootstrap assets (version 3) Imagine library JQuery UI (included with Yii) Installation: The preferred way to install this extension is through composer.

Install
-------

[](#install)

run

```
php composer.phar require resmedia/yii2-mongo-gallery-manager
```

or run

```
composer require resmedia/yii2-mongo-gallery-manager
```

or add to composer

```
{
  "resmedia/yii2-mongo-gallery-manager": "^1.1.1"
}
```

Usage
-----

[](#usage)

### 1) Add widget where you need to upload images

[](#1-add-widget-where-you-need-to-upload-images)

```
GalleryManager::widget([
    'model' => $model,
    'behaviorName' => 'galleryBehavior',
    'apiRoute' => 'galleryApi'
])
```

### 2) Add to controller examples

[](#2-add-to-controller-examples)

### with actions and behaviors

[](#with-actions-and-behaviors)

```
$actions['galleryApi'] = [
   'class' => GalleryManagerAction::class,
   'types' => [
       'news' => News::class
   ]
];
```

```
$behaviors['access']['rules'] = [
      [
           'actions' => [
                    ......, 'galleryApi',
           ],
           'allow' => true,
           'roles' => ['@'],
      ],
];
```

or only actions

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

### 3) Add to model

[](#3-add-to-model)

```
'galleryBehavior' => [
       'class' => GalleryBehavior::class,
       'type' => 'news',
       'extension' => 'jpg',
       // image dimmentions for preview in widget
       'previewWidth' => 300,
       'previewHeight' => 200,
       // path to location where to save images
       'directory' => Yii::getAlias('@api') . '/web/bucket/items',
          'url' => Yii::$app->params['domainFrontend'] . '/bucket/items',
          // additional image versions
          'versions' => [
              'original' => function ($img) {
                  $width = 1000;
                  $height = 550;
                  return $img
                      ->copy()
                      ->thumbnail(new Box($width, $height), ImageInterface::THUMBNAIL_OUTBOUND);
              },
              'medium' => function ($img) {
                  $width = 600;
                  $height = 328;
                  return $img
                      ->copy()
                      ->thumbnail(new Box($width, $height), ImageInterface::THUMBNAIL_OUTBOUND);
              },
              'preview' => function ($img) {
                  $width = 300;
                  $height = 164;
                  return $img
                      ->copy()
                      ->thumbnail(new Box($width, $height), ImageInterface::THUMBNAIL_OUTBOUND);
              },
          ]
      ],
 ]
```

See also [documentations of imagine](https://imagine.readthedocs.io/en/master/usage/introduction.html) for image transformations.

### 4) To get images

[](#4--to-get-images)

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

TODO
----

[](#todo)

*Make alert on big or small size*

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

1914d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d61c98740192da0945ff604ee6216f7dfb2f3ee780bc865322b4b7836e7fe705?d=identicon)[resmedia](/maintainers/resmedia)

---

Top Contributors

[![Resmedia](https://avatars.githubusercontent.com/u/9871970?v=4)](https://github.com/Resmedia "Resmedia (12 commits)")

---

Tags

imagemongodbyii2extensiongallery

### Embed Badge

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

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

###  Alternatives

[sjaakp/yii2-sortable-behavior

Sort ActiveRecords and related records in Yii2.

36144.7k](/packages/sjaakp-yii2-sortable-behavior)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)[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)
