yii2-extension yii2-single-file-upload
Single file upload extension
mztest/yii2-single-file-upload
Single file upload extension
- Wednesday, March 1, 2017
- by mztest
- Repository
- 1 Watchers
- 0 Stars
- 33 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 6 % Grown
Single file upload extension
Single file upload extension, (*1)
This package is deprecated
This package is deprecated. All the features were integrated into mztest/yii2-widget-file-upload, (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer.phar require --prefer-dist mztest/yii2-single-file-upload "*"
or add, (*5)
"mztest/yii2-single-file-upload": "*"
to the require section of your composer.json
file., (*6)
Usage
-
Define your web base url aliase '@frontendWeb', (*7)
Yii::setAlias('@frontendWeb', 'http://your.domain.com');
-
Set upload action at your controller, (*8)
public function actions()
{
return [
'upload' => [
'class' => 'mztest\singleFileUpload\actions\SingleFileUploadAction',
'uploadFolder' => 'your relative upload folder name.',
],
];
}
-
simply use it in your code by :, (*9)
<?= \mztest\singleFileUpload\SingelFileUpload::widget(); ?>
or, (*10)
<?= $form->field($model, 'floor_image')->widget(SingleFileUpload::className(), [
'uploadAction' => ['upload']
]) ?>