2017 © Pedro Peláez
 

yii2-extension yii2-jcrop

yii2 image cropping extension

image

codersgit/yii2-jcrop

yii2 image cropping extension

  • Wednesday, March 14, 2018
  • by CodersGit
  • Repository
  • 0 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 14 % Grown

The README.md

image cropping

yii2 image cropping extension, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist developit/yii2-jcrop "*"

or add, (*4)

"developit/yii2-jcrop": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

use developit\jcrop\Jcrop;
<?= $form->field($model, 'avatar')->widget(Jcrop::className(), [
    'uploadUrl' => Url::toRoute('/user/avatar'),
])->label(false) ?>

Widget has following properties:, (*7)

Name Description Default Required
uploadParameter Upload parameter name file No
width The final width of the image after cropping 200 No
height The final height of the image after cropping 200 No
uploadUrl URL for uploading and cropping image Yes
maxSize The maximum file size (b). 2097152 No
cropAreaWidth Width box for preview 300 No
cropAreaHeight Height box for preview 300 No
extensions Allowed file extensions (string). jpeg, jpg, png, gif No

In UserController:, (*8)

    public function actions()
    {
        return [
            'avatar' => [
                'class' => 'developit\jcrop\actions\Upload',
                'url' => '/common/files/',
                'path' => Yii::getAlias('@files'),
                'name' => Yii::$app->user->id
            ]
        ];
    }

Action has following parameters:, (*9)

Name Description Default Required
path Path for saving image after cripping Yes
url URL to which the downloaded images will be available. Yes
name uploded file name. No
uploadParameter Upload parameter name. It must match the value of a similar parameter of the widget. file No
maxSize The maximum file size (b). It must match the value of a similar parameter of the widget. 2097152 No
extensions Allowed file extensions (string). It must match the value of a similar parameter of the widget. jpeg, jpg, png, gif No
width The final width of the image after cropping. It must match the value of a similar parameter of the widget. 200 No
height The final height of the image after cropping. It must match the value of a similar parameter of the widget. 200 No

Operates as follows:

screenshot screenshot, (*10)

License

yii2-jcrop is an open source project modified by Ehsan Rezaei(http://www.developit.ir) that is licensed under GPL-3.0. used and modified from https://github.com/budyaga/yii2-cropper, (*11)

The Versions

14/03 2018

dev-master

9999999-dev

yii2 image cropping extension

  Sources   Download

GPL-3.0

The Requires

 

by Ehsan Rezaei
by Sergey Zhirov

extension yii2 jcrop crop image

14/03 2018

1.0.2

1.0.2.0

yii2 image cropping extension

  Sources   Download

GPL-3.0

The Requires

 

by Ehsan Rezaei
by Sergey Zhirov

extension yii2 jcrop crop image

14/02 2018

1.0.1

1.0.1.0

yii2 image cropping extension

  Sources   Download

GPL-3.0

The Requires

 

by Ehsan Rezaei

extension yii2 jcrop crop image

22/01 2017

1.0.0

1.0.0.0

yii2 image cropping extension

  Sources   Download

GPL-3.0

The Requires

 

by Ehsan Rezaei

extension yii2 jcrop crop image