PHPackages                             kr0lik/yii2-resource - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. kr0lik/yii2-resource

AbandonedArchivedYii2-extension[File &amp; Storage](/categories/file-storage)

kr0lik/yii2-resource
====================

Behaviour for resource store for Yii2

2.0.0(6y ago)092011MITPHPPHP &gt;=7.2

Since Apr 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/kr0lik/yii2-resource)[ Packagist](https://packagist.org/packages/kr0lik/yii2-resource)[ RSS](/packages/kr0lik-yii2-resource/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (3)Used By (1)

yii2-resource
=============

[](#yii2-resource)

Behaviour for resource store for Yii2

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require --prefer-dist kr0lik/yii2-resource "*"

```

or add

```
"kr0lik/yii2-resource": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Add \\kr0lik\\resource\\ResourceBehavior to your ActiveRecord

```
use yii\db\ActiveRecord;
use kr0lik\resource\ResourceBehavior;

class YourModel extends ActiveRecord
{
    ...
    public function behaviors()
    {
        return [
            'resource' => [
                'class' => ResourceBehavior::class,
                'attributes' => ['file'],
                'folder' => 'path/to/store/file/folder',
                'tmpFolder' => 'path/to/temp/file/folder'
                'originalFileNameAttribute' => 'attribute to store original file name. if null - no store'
            ]
        ];
    }
    ...
}
```

\*folders are relative to the directory web.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

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 ~397 days

Total

2

Last Release

2194d ago

Major Versions

1.0.0 → 2.0.02020-05-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0b0c887017cd70f427b564a667ef2433735f83c70f5ff987e2955c2c4962e60?d=identicon)[kr0lik](/maintainers/kr0lik)

---

Top Contributors

[![kr0lik](https://avatars.githubusercontent.com/u/12142976?v=4)](https://github.com/kr0lik "kr0lik (18 commits)")

---

Tags

fileresourceuploadyii2

### Embed Badge

![Health badge](/badges/kr0lik-yii2-resource/health.svg)

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

###  Alternatives

[nemmo/yii2-attachments

Extension for file uploading and attaching to the models

6616.6k5](/packages/nemmo-yii2-attachments)[liyunfang/yii2-upload-behavior

Upload behavior for Yii 2

161.7k](/packages/liyunfang-yii2-upload-behavior)

PHPackages © 2026

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