maddoger / yii2-filebehavior
There is no license information available for the latest version (v1.1.2) of this package.
File behavior for Yii2.
Package info
github.com/maddoger/yii2-filebehavior
Type:yii2-extension
pkg:composer/maddoger/yii2-filebehavior
v1.1.2
2016-03-31 17:56 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2026-03-01 01:23:04 UTC
README
File field behavior for Yii 2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist maddoger/yii2-filebehavior "*"
or add
"maddoger/yii2-filebehavior": "*"
to the require section of your composer.json file.
In model behaviors:
[
'class' => 'maddoger\filebehavior\FileBehavior',
'attribute' => 'file_attribute',
'deleteAttribute' => 'deleteFile',
'fileName' => function ($model, $file, $index) {
return md5($file->name).'.'.$file->extension;
},
'basePath' => '@webapp/uploads/files',
'baseUrl' => '@web/uploads/files',
'overwriteFile' => false,
],