PHPackages                             wdmg/yii2-media - 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. wdmg/yii2-media

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

wdmg/yii2-media
===============

Media library

2.0.1(2y ago)1666↓100%2[1 issues](https://github.com/wdmg/yii2-media/issues)1MITPHP

Since Dec 22Pushed 2y ago2 watchersCompare

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

READMEChangelog (3)Dependencies (5)Versions (13)Used By (1)

[![Yii2](https://camo.githubusercontent.com/3f29058a9886ae3e9efc09df82d551051f8ea6c8da1176d9e8ca8a64be6f9b40/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72657175697265642d596969325f76322e302e34302d626c75652e737667)](https://packagist.org/packages/yiisoft/yii2)[![Downloads](https://camo.githubusercontent.com/01ace4d59bfc38851fbfb6207a3182eee7dc20421b1f3c2937ef97ef363039cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77646d672f796969322d6d656469612e737667)](https://packagist.org/packages/wdmg/yii2-media)[![Packagist Version](https://camo.githubusercontent.com/7a7b0ca56f3483015dbe2c7d5ec0676ceb10da304a0958ca26a2c88be176ab10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77646d672f796969322d6d656469612e737667)](https://packagist.org/packages/wdmg/yii2-media)[![Progress](https://camo.githubusercontent.com/d2c102b075c16f8a841e697b04c43bc93c8d092c5795ad8b3090d7fa993c258a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d72656164795f746f5f7573652d677265656e2e737667)](https://camo.githubusercontent.com/d2c102b075c16f8a841e697b04c43bc93c8d092c5795ad8b3090d7fa993c258a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d72656164795f746f5f7573652d677265656e2e737667)[![GitHub license](https://camo.githubusercontent.com/f36152331bd2d332cecbe0d30fcac64338f4531d172b28a70a1a098b66a557a7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77646d672f796969322d6d656469612e737667)](https://github.com/wdmg/yii2-media/blob/master/LICENSE)

[![Yii2 Media](./docs/images/yii2-media.png)](./docs/images/yii2-media.png)

Yii2 Media
==========

[](#yii2-media)

Media library for Yii2 with media categories and drag'n'drop uploader.

This module is an integral part of the [Butterfly.СMS](https://butterflycms.com/) content management system, but can also be used as an standalone extension.

Copyrights (c) 2019-2023 [W.D.M.Group, Ukraine](https://wdmg.com.ua/)

Requirements
============

[](#requirements)

- PHP 5.6 or higher
- Yii2 v.2.0.40 and newest
- [Yii2 Base](https://github.com/wdmg/yii2-base) module (required)
- [Yii2 Imagine](https://github.com/yiisoft/yii2-imagine) extension (required)
- [Yii2 SelectInput](https://github.com/wdmg/yii2-selectinput) widget

Installation
============

[](#installation)

To install the module, run the following command in the console:

`$ composer require "wdmg/yii2-media"`

After configure db connection, run the following command in the console:

`$ php yii media/init`

And select the operation you want to perform:

1. Apply all module migrations
2. Revert all module migrations

Migrations
==========

[](#migrations)

In any case, you can execute the migration and create the initial data, run the following command in the console:

`$ php yii migrate --migrationPath=@vendor/wdmg/yii2-media/migrations`

Configure
=========

[](#configure)

To add a module to the project, add the following data in your configuration file:

```
'modules' => [
    ...
    'media' => [
        'class' => 'wdmg\media\Module',
        'routePrefix' => 'admin',
        'mediaRoute' => '/media', // Routes to render media item (use "/" - for root)
        'mediaCategoriesRoute' => '/media/categories', // Routes to render media categories (use "/" - for root)
        'mediaPath' => '/uploads/media', // Path to save media files in @webroot
        'mediaThumbsPath' => '/uploads/media/_thumbs', // Path to save media thumbnails in @webroot
        'maxFilesToUpload' => 10, // maximum files to upload
        'maxUploadSize' => 5242880, // max file size in bytes to upload
        'allowedMime' => [ // allowed mime types
            'image/png' => true,
            'image/jpeg' => true,
            'image/gif' => true,
            'image/svg+xml' => true,
            'application/pdf' => true,
            'application/msword' => true,
            'application/vnd.ms-excel' => true,
            'application/rtf' => true,
            'text/csv' => true,
            'text/plain' => true,
            ...
        ]
    ],
    ...
],

```

Routing
=======

[](#routing)

Use the `Module::dashboardNavItems()` method of the module to generate a navigation items list for NavBar, like this:

```

```

Status and version \[ready to use\]
===================================

[](#status-and-version-ready-to-use)

- v.2.0.1 - Update dependencies
- v.2.0.0 - Some fix, update copyrights
- v.1.0.6 - RBAC implementation, read EXIF
- v.1.0.5 - Update README.md

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Recently: every ~291 days

Total

12

Last Release

1040d ago

Major Versions

0.0.3 → 1.0.02020-03-20

1.0.6 → 2.0.02023-06-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1635637?v=4)[Alexsander Vyshnyvetskyy](/maintainers/alex-wdmg)[@alex-wdmg](https://github.com/alex-wdmg)

---

Top Contributors

[![alex-wdmg](https://avatars.githubusercontent.com/u/1635637?v=4)](https://github.com/alex-wdmg "alex-wdmg (34 commits)")

---

Tags

librarymanagermediayii2wdmgyii2-media

### Embed Badge

![Health badge](/badges/wdmg-yii2-media/health.svg)

```
[![Health](https://phpackages.com/badges/wdmg-yii2-media/health.svg)](https://phpackages.com/packages/wdmg-yii2-media)
```

###  Alternatives

[yiimaker/yii2-social-share

Extension for sharing on social networks

48111.3k4](/packages/yiimaker-yii2-social-share)[tomatophp/filament-media-manager

Manage your media files using spatie media library with easy to use GUI for FilamentPHP

14543.9k3](/packages/tomatophp-filament-media-manager)[asgardcms/media-module

Media module for AsgardCMS. Handles the media library.

1130.6k2](/packages/asgardcms-media-module)[maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

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

 yii2 image cropping extension

101.5k](/packages/developit-yii2-jcrop)

PHPackages © 2026

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