dev-master
9999999-devyii2-webuploader
BSD-3-Clause
The Requires
by hoter
extension yii2
yii2-webuploader
yii2-webuploader 組件。, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist xinyeweb/yii2-webuploader "dev-master"
or add, (*4)
"xinyeweb/yii2-webuploader": "dev-master"
to the require section of your composer.json
file., (*5)
單圖使用 :, (*6)
<?= \xinyeweb\webuploader\WebUploader::className(); ?>
多圖使用 :, (*7)
<?= $form->field($model, 'pics')->widget(\xinyeweb\webuploader\WebUploader::className(),[ 'clientOptions' => [ 'pick' => [ 'multiple' => true, ], ] ]) ?>
Controller 中配置上傳 :, (*8)
public function actions() { return ArrayHelper::merge(parent::actions(), [ 'upload' => [ 'class' => '\xinyeweb\webuploader\WebUploaderAction', ], ]); }
高級版 上傳目錄, (*9)
Yii::setAlias('@upload', dirname(dirname(__DIR__)) . '/web/uploads'); //存储目录path
基礎版 上傳目錄 入口文件, (*10)
Yii::setAlias('@upload', __DIR__ . '/uploads'); //存储目录path
yii2-webuploader
BSD-3-Clause
extension yii2