yiidoc / yii2-upload-behavior
Yii2 Upload File Behavior
Package info
github.com/yiidoc/yii2-upload-behavior
Type:yii2-extension
pkg:composer/yiidoc/yii2-upload-behavior
2.0.0
2015-06-02 20:13 UTC
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2026-02-25 11:04:56 UTC
README
Yii2 Upload File Behavior
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist yiidoc/yii2-upload-behavior "*"
or add
"yiidoc/yii2-upload-behavior": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
public function behaviors() { return [ [ 'class' => 'yii\behaviors\UploadFileBehavior', 'attribute' => 'picture', 'uploadDir' => '@webroot/uploads/user/pictures' ] ]; }