platx/yii2-uploads-action For individual use.

uploads

Yii2 Uploads Action

For individual use.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist platx/yii2-uploads-action "*"

or add

"platx/yii2-uploads-action": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, add this action to your controller :

public function actions()
{
    return [
        'uploads' => [
            'class' => 'platx\uploads\UploadsAction',
        ],
        ...
    ];
}

In your url rules add following rules:

'uploads/<width:\d+>x<height:\d+>/<model:[\w_]+>/<field:[\w-]+>/<dp:[\d\/]+>/<file:[\w-]+>.<ext:\w+>' => '{your_controller}/uploads',
'uploads/original/<model:[\w_]+>/<field:[\w-]+>/<dp:[\d\/]+>/<file:[\w-]+>.<ext:\w+>' => '{your_controller}/uploads',

Nginx config:

location ~* /uploads/(\d+)/(\d+) {
    index index.php;
    try_files $uri $uri/ /index.php?$args;
}

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

No stable releases.

Comments



No stable releases.



MIT license
Stats
0 github stars & 0 github forks
0 downloads in the last day
72 downloads in the last 30 days
1215 total downloads