kmergen/yii2-media

A Yii2 Media management extension

Installs: 203

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:yii2-extension

dev-master 2021-12-21 15:28 UTC

This package is auto-updated.

Last update: 2021-12-21 15:29:07 UTC


README

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.

Installation

1. Run Migrations

Run $ yii migrate --migrationPath=@vendor/kmergen/yii2-media/migrations

2. Configuration

In your configuration file set the following:

'bootstrap' => [
    'kmergen\media\Bootstrap',
    ...
],
'modules' => [
    'media' => [
        'class' => 'kmergen\media\Module'
    ],
    ...
]

3. Image component

'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')".

4. Upload files with integrated dropzone widget

Note: This extension is under development. Use it not in production.