Yii2 extension to provide media file management with model fileupload Uploaded files managed all in a database table.
The preferred way to install this extension is through composer.
Either run
composer require "kmergen/yii2-media: "*"
or add
"kmergen/yii2-media": "*",
to the require
section of your composer.json
file.
Run $ yii migrate --migrationPath=@vendor/kmergen/yii2-media/migrations
In your configuration file set the following:
'bootstrap' => [
'kmergen\media\Bootstrap',
...
],
'modules' => [
'media' => [
'class' => 'kmergen\media\Module'
],
...
]
'components' => [
'image' => [
'class' => 'kmergen\media\components\Image'
],
...
]
Now you can everywhere in your application e.g. get a thumb with "Yii::$app->image->thumb('path/to/original/image', '$thumbStyle')".
Note: This extension is under development. Use it not in production.