PHPackages                             punjabideveloper/yii2-cropper - 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. [Framework](/categories/framework)
4. /
5. punjabideveloper/yii2-cropper

ActiveYii2-extension[Framework](/categories/framework)

punjabideveloper/yii2-cropper
=============================

Yii2 + Cropper integration extension

v2.5(5y ago)05MITPHPPHP &gt;=5.6.0

Since Dec 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/punjabideveloper/yii2-cropper)[ Packagist](https://packagist.org/packages/punjabideveloper/yii2-cropper)[ RSS](/packages/punjabideveloper-yii2-cropper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (8)Used By (0)

Yii2 + Cropper integration Extension
====================================

[](#yii2--cropper-integration-extension)

This extension integrates [Cropper](https://github.com/fengyuanchen/cropperjs) with Yii2 apps. It provides assets and a widget to facilitate uploads of cropped images.

Usage
-----

[](#usage)

Yii2-Cropper provides an widget plus an upload file class that inherits from [yii\\web\\UploadedFile](https://www.yiiframework.com/doc/api/2.0/yii-web-uploadedfile). That allows you to use native semantics for uploading files with this extension.

On your model
-------------

[](#on-your-model)

```
class Form extends \yii\base\Model
{
    public $image;

    public function rules()
    {
        return [
            ['image', 'image', 'enableClientValidation' => FALSE],
        ];
    }
}
```

**IMPORTANT**: If you use `image` validation in your model (recommended), you **must** disable client validation, as shown above.

In your view
------------

[](#in-your-view)

```
$form->field($model, 'image')
    ->widget(\fv\yii\Cropper\Widget::class)
```

In your controller
------------------

[](#in-your-controller)

```
if ($app->request->isPost) {
   $form->image = \fv\yii\Cropper\UploadedFile::getInstance($form, 'image');

   if ($form->validate())
   {
        $name = '/tmp/' . $form->image->baseName
            . '.' . $form->image->extension;

        $form->image->saveAs($name);
        $app->session->setFlash('success',
            'Saved to ' . Html::encode($name));
        return $this->refresh();
    }
}
```

Notes
-----

[](#notes)

No actual file upload by the browser happens. Consequently, the extension never gets to know the name of the file that got sent for cropping, and for compatibility with `yii\web\UploadedFile`, a random name is generated.

Issues
------

[](#issues)

See

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

7

Last Release

1965d ago

Major Versions

v1.0 → v2.02020-12-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/01432d79cda39238f336491bf143181522cf2e928dbd819b91b47b874fda476a?d=identicon)[punjabideveloper](/maintainers/punjabideveloper)

---

Top Contributors

[![guri-dev](https://avatars.githubusercontent.com/u/7647307?v=4)](https://github.com/guri-dev "guri-dev (15 commits)")

### Embed Badge

![Health badge](/badges/punjabideveloper-yii2-cropper/health.svg)

```
[![Health](https://phpackages.com/badges/punjabideveloper-yii2-cropper/health.svg)](https://phpackages.com/packages/punjabideveloper-yii2-cropper)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
