xinyeweb/yii2-webuploader
Composer 安装命令:
composer require xinyeweb/yii2-webuploader
包简介
yii2-webuploader
关键字:
README 文档
README
yii2-webuploader 組件。
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist xinyeweb/yii2-webuploader "dev-master"
or add
"xinyeweb/yii2-webuploader": "dev-master"
to the require section of your composer.json file.
Usage
單圖使用 :
<?= \xinyeweb\webuploader\WebUploader::className(); ?>
多圖使用 :
<?= $form->field($model, 'pics')->widget(\xinyeweb\webuploader\WebUploader::className(),[ 'clientOptions' => [ 'pick' => [ 'multiple' => true, ], ] ]) ?>
Controller 中配置上傳 :
public function actions() { return ArrayHelper::merge(parent::actions(), [ 'upload' => [ 'class' => '\xinyeweb\webuploader\WebUploaderAction', ], ]); }
高級版 上傳目錄
Yii::setAlias('@upload', dirname(dirname(__DIR__)) . '/web/uploads'); //存储目录path
基礎版 上傳目錄 入口文件
Yii::setAlias('@upload', __DIR__ . '/uploads'); //存储目录path
统计信息
- 总下载量: 68
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-09-07