meliorator/yii2-picturizer

Yii-Framework extension for uploading and cropping images

Installs: 70

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2020-03-19 17:43 UTC

This package is auto-updated.

Last update: 2025-04-20 04:49:11 UTC


README

Yii-Framework extension for uploading and cropping images.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist meliorator/yii2-picturizer "*"

or add

"meliorator/yii2-picturizer": "*"

to the require section of your composer.json file.

Differences another extensions for JCrop library

Picturizer does not use the ajax-simple-upload-button or another ajax upload methods. Picturizer use only the HTTP POST method for upload files.

Usage

Once the extension is installed, simply use it in your code by :

<?= \meliorator\picturizer\Picturizer::widget(); ?>

and need attach behavior PicturizerControllerBehavior to controller. Example :

use meliorator\picturizer\PicturizerControllerBehavior;
 return [                
                'avatar' => [
                    'class' => PicturizerControllerBehavior::className(),
                    'savePath' => '@webroot/images/employees' 
                ]
            ];
         

and call saveUploadedImage method for save image :

$newFileName = $this->saveUploadedImage();