PHPackages                             bigdropinc/yii2-image-manager-mongo - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. bigdropinc/yii2-image-manager-mongo

ActiveYii2-extension[File &amp; Storage](/categories/file-storage)

bigdropinc/yii2-image-manager-mongo
===================================

A Yii2 module/widget for upload and cropping images for MongoDB

v2.6.3(7y ago)03.8kBSD-3-ClausePHP

Since Sep 25Pushed 7y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (8)Versions (66)Used By (0)

Image manager for Yii2
======================

[](#image-manager-for-yii2)

A Yii2 module/widget for upload, manage and cropping images

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

[](#installation)

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

- Either run

```
php composer.phar require "bigdropinc/yii2-image-manager-mongo" "*"

```

or add

```
"bigdropinc/yii2-image-manager-mongo" : "*"
```

to the require section of your application's `composer.json` file.

- Add a new component in `components` section of your application's configuration file, for example:

```
'components' => [
    'imagemanager' => [
		'class' => 'noam148\imagemanager\components\ImageManagerGetPath',
		//set media path (outside the web folder is possible)
		'mediaPath' => '/path/where/to/store/images/media/imagemanager',
		//path relative web folder to store the cache images
		'cachePath' => ['assets/images'],
		//use filename (seo friendly) for resized images else use a hash
		'useFilename' => true,
		//show full url (for example in case of a API)
		'absoluteUrl' => false,
		'databaseComponent' => 'db' // The used database component by the image manager, this defaults to the Yii::$app->db component
        'useTinyPng' => true,

        'useS3' => true,
        's3Configuration' => [
            'key' => 'key',
            'secret' => 'key123',
	        's3Url' => 'http://localhost:9001/',
            //endpoint set only for local version of services such as minio
            'endpoint' => 'http://localhost:9000',
            'defaultBucket' => 'default',
        ]
	],
],
```

and in `modules` section, for example:

```
'modules' => [
	'imagemanager' => [
		'class' => 'noam148\imagemanager\Module',
		//set accces rules ()
		'canUploadImage' => true,
		'canRemoveImage' => function(){
			return true;
		},
		'deleteOriginalAfterEdit' => false, // false: keep original image after edit. true: delete original image after edit
		// Set if blameable behavior is used, if it is, callable function can also be used
		'setBlameableBehavior' => false,
		//add css files (to use in media manage selector iframe)
		'cssFiles' => [
			'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css',
		],
	],
],
```

Usage
-----

[](#usage)

[![Image manager module](/docs/images/img_doc-image-manager.jpg)](/docs/images/img_doc-image-manager.jpg)[![Image manager module cropper](/docs/images/img_doc-image-manager-crop.jpg)](/docs/images/img_doc-image-manager-crop.jpg)

To load the image picker see below (make sure you have a field in you table where the module can store 'id' of the ImageManager table):

```
echo $form->field($model, 'ImageManager_id_avatar')->widget(\noam148\imagemanager\widgets\ImageManagerInput::className(), [
	'aspectRatio' => (16/9), //set the aspect ratio
    'cropViewMode' => 1, //crop mode, option info: https://github.com/fengyuanchen/cropper/#viewmode
	'showPreview' => true, //false to hide the preview
	'showDeletePickedImageConfirm' => false, //on true show warning before detach image
	'multiple' => false,
    'models' => $models, //selected models
]);
```

[![Image widget](/docs/images/img_doc-image-widget.jpg)](/docs/images/img_doc-image-widget.jpg)[![Image widget popup](/docs/images/img_doc-image-widget-popup.jpg)](/docs/images/img_doc-image-widget-popup.jpg)

If you want to use a image:

```
/*
 * $ImageManager_id (id that is store in the ImageManager table)
 * $width/$height width height of the image
 * $thumbnailMode = "outbound" or "inset"
 */
\Yii::$app->imagemanager->getImagePath($ImageManager_id, $width, $height,$thumbnailMode)
```

Support CKEditor &amp; TinyMce
------------------------------

[](#support-ckeditor--tinymce)

For using the filebrowser in CKEditor add the filebrowserImageBrowseUrl to the clientOptions of the CKEditor widget. I test it only for the CKEditor from 2amigOS but it need to work on other CKEditor widgets.

```
use dosamigos\ckeditor\CKEditor;

 echo $form->field($model, 'text')->widget(CKEditor::className(), [
	'options' => ['rows' => 6],
	'preset' => 'basic',
	'clientOptions' => [
		'filebrowserImageBrowseUrl' => yii\helpers\Url::to(['imagemanager/manager', 'view-mode'=>'iframe', 'select-type'=>'ckeditor']),
	]
]);
```

For using the filebrowser in TinyMce add the file\_browser\_callback to the clientOptions of the TinyMce widget. I test it only for the TinyMce from 2amigOS but it need to work on other TinyMce widgets. (don't forget add 'image' to your 'plugins' array)

```
use dosamigos\tinymce\TinyMce;

echo $form->field($model, 'text')->widget(TinyMce::className(), [
	'options' => ['rows' => 6],
	'language' => 'nl',
	'clientOptions' => [
		'file_browser_callback' => new yii\web\JsExpression("function(field_name, url, type, win) {
			window.open('".yii\helpers\Url::to(['imagemanager/manager', 'view-mode'=>'iframe', 'select-type'=>'tinymce'])."&tag_name='+field_name,'','width=800,height=540 ,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no');
		}"),
		'plugins' => [
			"advlist autolink lists link charmap print preview anchor",
			"searchreplace visualblocks code fullscreen",
			"insertdatetime media table contextmenu paste image"
		],
		'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
	]
]);
```

**If you got questions, tips or feedback? Please, let me know!**

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 52.5% 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 ~13 days

Recently: every ~50 days

Total

61

Last Release

2730d ago

Major Versions

1.2.6 → v2.02017-10-31

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3830013?v=4)[poprigun](/maintainers/poprigun)[@poprigun](https://github.com/poprigun)

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

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

---

Top Contributors

[![noam148](https://avatars.githubusercontent.com/u/10885039?v=4)](https://github.com/noam148 "noam148 (31 commits)")[![bvanleeuwen1995](https://avatars.githubusercontent.com/u/10004134?v=4)](https://github.com/bvanleeuwen1995 "bvanleeuwen1995 (15 commits)")[![poprigun13](https://avatars.githubusercontent.com/u/11268541?v=4)](https://github.com/poprigun13 "poprigun13 (5 commits)")[![poprigun](https://avatars.githubusercontent.com/u/3830013?v=4)](https://github.com/poprigun "poprigun (4 commits)")[![romanbur](https://avatars.githubusercontent.com/u/6098800?v=4)](https://github.com/romanbur "romanbur (3 commits)")[![KolyaSirik](https://avatars.githubusercontent.com/u/11480548?v=4)](https://github.com/KolyaSirik "KolyaSirik (1 commits)")

---

Tags

imagemanageruploadyii2extensionmodulewidgetcropmongo

### Embed Badge

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

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

###  Alternatives

[noam148/yii2-image-manager

A Yii2 module/widget for upload and cropping images

12914.8k](/packages/noam148-yii2-image-manager)[sjaakp/yii2-illustrated-behavior

ActiveRecord Behavior with associated Widget for Yii2.

423.1k](/packages/sjaakp-yii2-illustrated-behavior)[budyaga/yii2-cropper

Yii-Framework widget for uploading and cropping images

4368.5k4](/packages/budyaga-yii2-cropper)[rkit/filemanager-yii2

FileManager for Yii2

181.3k](/packages/rkit-filemanager-yii2)

PHPackages © 2026

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