alkurn/yii2-upload

Yii2 helper for creating and upload file or files

Installs: 837

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Type:yii2-extension

v1.0.10 2019-01-10 10:31 UTC

This package is not auto-updated.

Last update: 2024-05-10 01:45:35 UTC


README

Yii2 helper for creating and caching thumbnails on real time.

Installation

The preferred way to install this extension is through composer.

  • Either run
php composer.phar require --prefer-dist alkurn/yii2-upload "dev-master"

or add

"alkurn/yii2-upload" : "*"

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

  • Add a new component in components section of your application's configuration file (optional), for example:
'components' => [ 
    'upload' => [
                'class' =>'alkurn\upload\Upload',
                'uploadsAlias' => Yii::getAlias('@storage/'),
                'uploadsModel' => CoreMedia::class,
            ],
]

and in bootstrap section, for example:

'bootstrap' => ['log', 'thumbnail', 'upload'],

It is necessary if you want to set global helper's settings for the application.

Usage

For example:

use alkurn\upload\Upload;

$image = Yii::$app->upload->upload('image', $model);