library yii2-widget-file-upload
A widget for uploading files to your server.
mztest/yii2-widget-file-upload
A widget for uploading files to your server.
- Wednesday, March 1, 2017
- by mztest
- Repository
- 0 Watchers
- 0 Stars
- 45 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 2 Versions
- 22 % Grown
Easily upload any files to your server in Yii Framework 2.0.
The extension uses the jQueryFileUpload., (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist mztest/yii2-widget-file-upload "*"
or add, (*4)
"mztest/yii2-widget-file-upload": "*"
to the require section of your composer.json
file., (*5)
Usage
-
Set upload action at your controller, (*6)
public function actions()
{
return [
'upload' => [
'class' => 'mztest\upload\actions\FileUploadAction',
],
];
}
-
simply use it in your code by :, (*7)
use mztest\upload\FileUpload;
<?= $form->field($model, 'floor_image')->widget(FileUpload::className(), [
'uploadAction' => ['upload']
]) ?>