yiidoc / yii2-upload-behavior
Yii2 Upload File Behavior
Installs: 70
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-10-25 08:07:33 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' ] ]; }