PHP code example of doris / yii2-upload-file

1. Go to this page and download the library: Download doris/yii2-upload-file 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/ */

    

doris / yii2-upload-file example snippets



use yii\helpers\ArrayHelper;
use doris\uploadFile\actions\UploadFileAction;
use doris\uploadFile\actions\DeleteFileAction;

class PostController extends \yii\web\Controller
{
   public function actions()
    {
        return ArrayHelper::merge(parent::actions(),[
                'upload-file' => ['class' => UploadFileAction::class], //action for uploading file                   
                'delete-file' => ['class' => DeleteFileAction::class], //action for deleting file
            ]);
        }
}


use doris\uploadFile\components\Uploader;
use doris\uploadFile\UploadFileWidget;


use doris\uploadFile\components\Uploader;
use doris\uploadFile\UploadFileWidget;


use doris\uploadFile\components\Uploader;
use doris\uploadFile\UploadFileWidget;
use doris\uploadFile\components\FileUploader;


use doris\uploadFile\components\Uploader;
use doris\uploadFile\UploadFileWidget;

"doris/yii2-upload-file": "dev-master"