kmergen/yii2-media

A Yii2 Media management extension

Installs: 214

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2023-07-02 12:33 UTC

This package is auto-updated.

Last update: 2024-10-31 00:23:17 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.