PHPackages                             colee/yii2-behavior - 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. colee/yii2-behavior

ActiveLibrary

colee/yii2-behavior
===================

behavior library for Yii2 framework

09PHP

Since May 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/colee1985/yii2-behavior)[ Packagist](https://packagist.org/packages/colee/yii2-behavior)[ RSS](/packages/colee-yii2-behavior/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-behavior
=============

[](#yii2-behavior)

---

### model在保存前，处理附件字段，如果字段有附件上传，则将附件存到OSS，然后把访问路径设为字段值

[](#model在保存前处理附件字段如果字段有附件上传则将附件存到oss然后把访问路径设为字段值)

> usage

```
public function behaviors()
{
    return [
        'uploadbehavior' => [
            'class' => UploadBehavior::className(),
            'fields' => ['cover', 'avatar'],
            'generate'=>[
            	// 自定义文件路径规则
                'cover'=>function($file){
                    return date('Ymd').'/'.$file->name;
                }
            ],
        ]
    ];
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![lidenggao](https://avatars.githubusercontent.com/u/1161635?v=4)](https://github.com/lidenggao "lidenggao (10 commits)")

### Embed Badge

![Health badge](/badges/colee-yii2-behavior/health.svg)

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

PHPackages © 2026

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