PHP code example of mztest / yii2-single-file-upload

1. Go to this page and download the library: Download mztest/yii2-single-file-upload library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mztest / yii2-single-file-upload example snippets


    Yii::setAlias('@frontendWeb', 'http://your.domain.com');
    

    public function actions()
        {
            return [
                'upload' => [
                    'class' => 'mztest\singleFileUpload\actions\SingleFileUploadAction',
                    'uploadFolder' => 'your relative upload folder name.',
                ],
            ];
        }
    

    <?= \mztest\singleFileUpload\SingelFileUpload::widget(); 

    <?= $form->field($model, 'floor_image')->widget(SingleFileUpload::className(), [
        'uploadAction' => ['upload']
    ]) 

php composer.phar 

"mztest/yii2-single-file-upload": "*"