2017 © Pedro Peláez
 

library yii2-behavior

behavior library for Yii2 framework

image

colee/yii2-behavior

behavior library for Yii2 framework

  • Sunday, May 1, 2016
  • by colee
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

# yii2-behavior

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

usage, (*1)

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

The Versions

01/05 2016

dev-master

9999999-dev https://github.com/colee1985/yii2-behavior

behavior library for Yii2 framework

  Sources   Download

MIT

The Requires

 

by Avatar colee

file yii2 upload image yii2-behavior colee