@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | if (empty($this->url)) { |
| 96 | 96 | if ($this->onlyImage === false) { |
| 97 | 97 | $this->url = $this->multiple ? ['/upload/files-upload'] : ['/upload/file-upload']; |
| 98 | - $fileAllowFiles = Yii::$app->getSettings()->get('fileAllowFiles','attachment'); |
|
| 98 | + $fileAllowFiles = Yii::$app->getSettings()->get('fileAllowFiles', 'attachment'); |
|
| 99 | 99 | $regExp = '/(\.|\/)('; |
| 100 | 100 | $extensions = explode(',', $fileAllowFiles); |
| 101 | 101 | foreach ($extensions as $extension) { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | $this->fileInputName = md5($this->name); |
| 132 | 132 | if (!array_key_exists('file_param', $this->url)) { |
| 133 | - $this->url['file_param'] = $this->fileInputName;//服务器需要通过这个判断是哪一个input name上传的 |
|
| 133 | + $this->url['file_param'] = $this->fileInputName; //服务器需要通过这个判断是哪一个input name上传的 |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | $this->clientOptions = ArrayHelper::merge($this->clientOptions, [ |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | protected function formatAttachment($attachment) |
| 161 | 161 | { |
| 162 | 162 | if (!empty($attachment) && is_string($attachment)) { |
| 163 | - return ['url' => $attachment, 'path' => $attachment,]; |
|
| 163 | + return ['url' => $attachment, 'path' => $attachment, ]; |
|
| 164 | 164 | } else if (is_array($attachment)) { |
| 165 | 165 | return $attachment; |
| 166 | 166 | } else if ($attachment instanceof Arrayable) |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public static function getImageMaxSizeByte() |
| 48 | 48 | { |
| 49 | - $imageMaxSize = Yii::$app->getSettings()->get('imageMaxSize','attachment'); |
|
| 49 | + $imageMaxSize = Yii::$app->getSettings()->get('imageMaxSize', 'attachment'); |
|
| 50 | 50 | return self::getMaxUploadByte($imageMaxSize); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public static function getVideoMaxSizeByte() |
| 58 | 58 | { |
| 59 | - $videoMaxSize = Yii::$app->getSettings()->get('videoMaxSize','attachment'); |
|
| 59 | + $videoMaxSize = Yii::$app->getSettings()->get('videoMaxSize', 'attachment'); |
|
| 60 | 60 | return self::getMaxUploadByte($videoMaxSize); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public static function getFileMaxSizeByte() |
| 68 | 68 | { |
| 69 | - $fileMaxSize = Yii::$app->getSettings()->get('fileMaxSize','attachment'); |
|
| 69 | + $fileMaxSize = Yii::$app->getSettings()->get('fileMaxSize', 'attachment'); |
|
| 70 | 70 | return self::getMaxUploadByte($fileMaxSize); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public static function getAcceptImageMimeTypes() |
| 78 | 78 | { |
| 79 | - $imageAllowFiles = Yii::$app->getSettings()->get('imageAllowFiles','attachment'); |
|
| 79 | + $imageAllowFiles = Yii::$app->getSettings()->get('imageAllowFiles', 'attachment'); |
|
| 80 | 80 | $extensions = explode(',', $imageAllowFiles); |
| 81 | - array_walk($extensions, function (&$value) { |
|
| 81 | + array_walk($extensions, function(&$value) { |
|
| 82 | 82 | $value = 'image/' . $value; |
| 83 | 83 | }); |
| 84 | 84 | return $extensions; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | public static function normalizeExtension($extensions) |
| 94 | 94 | { |
| 95 | 95 | $extensions = explode(',', $extensions); |
| 96 | - array_walk($extensions, function (&$value) { |
|
| 96 | + array_walk($extensions, function(&$value) { |
|
| 97 | 97 | $value = '.' . $value; |
| 98 | 98 | }); |
| 99 | 99 | return $extensions; |