PHPackages                             alex290/yii2-widget-gallery - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. alex290/yii2-widget-gallery

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

alex290/yii2-widget-gallery
===========================

Yii2 Widget gallery

0.1.1(5y ago)1281MITJavaScript

Since Dec 10Pushed 5y ago1 watchersCompare

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

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

Widget gallery
==============

[](#widget-gallery)

Yii2 Widget gallery

Installation
------------

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist alex290/yii2-widget-gallery "*"

```

or add

```
"alex290/yii2-widget-gallery": "*"

```

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

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

в конфиге web.php прописать

```
'modules' => [
    'widget-gallery' => [
        'class' => 'alex290\widgetgallery\Module',
        'path' => 'upload', //path to files
    ],
],

```

run migrate

php yii migrate/up --migrationPath=@vendor/alex290/yii2-widget-gallery/migrations

attach behaviour to your model (be sure that your model has "id" property)

```
public function behaviors()
{
    return [
        'gallery' => [
            'class' => 'alex290\widgetgallery\behaviors\Behave',
        ]
    ];
}

```

Вывести виджет в админке

```

$title = false

```

Скрывает поле $title

```
$desc = false

```

Скрывает поле $desc

Добавить к модели новые изображения

```
$model->attachGellery([
    '../../image.png',
    '../../image1.png',
    //...
]);

```

Изменить данные в объекте галереи

```
$model->updateGalleryItem($id, $title = 'Заголовок', $desc = 'Описание');

```

$title и $desc - Необязательны

Получить массив объектов виджетов данной модели

```
$model->getGallery();

```

В контролле для загрузки или изменения данных

```
if ($model->load(Yii::$app->request->post()) && $model->save()) {
    $model->getNewImages()->upload($model);

    ...
}

```

Удалить виджеты

```
$model->removeGalleryAll();

$model->removeGalleryItem($id);

```

Выводить записи на странице

```

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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 ~4 days

Total

2

Last Release

1976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35fd7f2d7b8be6fef06a2c6aee576282f55559098fd5d6075a7fedc80df48f34?d=identicon)[alex290](/maintainers/alex290)

---

Top Contributors

[![alex290](https://avatars.githubusercontent.com/u/13647764?v=4)](https://github.com/alex290 "alex290 (1 commits)")

---

Tags

yii2extension

### Embed Badge

![Health badge](/badges/alex290-yii2-widget-gallery/health.svg)

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

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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