0

Yii2 Image Cropper

A simple wrapper for the imgAreaSelect jquery plugin

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist cozumel/yii2-image-cropper "*"

or add

"cozumel/yii2-image-cropper": "*"

to the require section of your composer.json file.

Usage

yii2 image cropper

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

Example

View File:

 

Where user_profile_photo is the id of the image to use.

Html in view file:

The main image you will be cropping:

 

The preview image: (the ids here are fixed, and the 75px must be stated but can be changed)

 

The form to send the information to your controller:

 

Javascript to submit the form:

 

Your controller function:

 

Save

Save

Save

 

Prakash S

Prakash S

I would like to introduce myself as a Software professional opting for the career in software industry. I'm Prakash S, a MCA graduate and trained as industry level practice for Software technology. Basically I am a PHP Developer but now days exploring more in HTML5, CSS, AngularJS and jQuery libraries.