PHPackages                             ereminmdev/yii2-croppieimageupload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ereminmdev/yii2-croppieimageupload

ActiveYii2-extension

ereminmdev/yii2-croppieimageupload
==================================

Crop image upload for Yii framework.

1.0.26(9mo ago)052MITPHPPHP &gt;=7.4

Since Jun 2Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/ereminmdev/yii2-croppieimageupload)[ Packagist](https://packagist.org/packages/ereminmdev/yii2-croppieimageupload)[ Docs](https://github.com/ereminmdev/yii2-croppieimageupload)[ RSS](/packages/ereminmdev-yii2-croppieimageupload/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (27)Used By (0)

yii2-croppieimageupload
=======================

[](#yii2-croppieimageupload)

Crop image upload for Yii framework.

This widget depends on:

-
-

Install
-------

[](#install)

`composer require --prefer-dist ereminmdev/yii-croppieimageupload`

Use
---

[](#use)

```
public function behaviors()
{
    return [
        ...
        'avatar' => [
            'class' => CroppieImageUploadBehavior::class,
            'attribute' => 'avatar',
            'scenarios' => ['create', 'update'],
            'placeholder' => '@app/modules/user/assets/images/avatar.jpg',
            'path' => '@webroot/upload/avatar/{id}',
            'url' => '@web/upload/avatar/{id}',
            'thumbs' => [
                'thumb' => ['width' => 42, 'height' => 42, 'mode' => ManipulatorInterface::THUMBNAIL_OUTBOUND],
                'preview' => ['width' => 200, 'height' => 200, 'mode' => ManipulatorInterface::THUMBNAIL_OUTBOUND],
            ],
            'ratio' => 1,
        ],
    ];
}

```

View file:

```
