PHP code example of mztest / yii2-widget-upload-oss

1. Go to this page and download the library: Download mztest/yii2-widget-upload-oss 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-widget-upload-oss example snippets


   public function actions()
   {
       return [
           'upload' => [
               'oss-signature' => [
                   'class' => 'mztest\uploadOSS\actions\Signature',
                   'accessKeyId' => 'Your aliyunOSS access key id here.',
                   'accessKeySecret' => 'Your aliyunOSS access secret id here.',
                   'host' => 'Your aliyunOSS upload bucket url',
               ],
           ],
       ];
   }
   

   <?= \mztest\uploadOSS\FileUploadOSS::widget(); 

   <?= $form->field($model, 'url')->widget(FileUploadOSS::className(), [
       'signatureAction' => ['oss-signature']
   ]) 

php composer.phar