2017 © Pedro Peláez
 

yii2-extension image

多图上传插件

image

huanguang/image

多图上传插件

  • Saturday, April 8, 2017
  • by huanguang
  • Repository
  • 0 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

多图上传带删除功能

多图上传yii2组件,, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist huanguang/image "dev-master"

or add, (*4)

"huanguang/image": "dev-master"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

```php, (*7)

//在当前控制器的actions中添加如下配置 public function actions() { return [ 'image-upload' => [ 'class' => UploadsAction::className(), //磁盘目录 'basePath' => '@webroot/upload', //访问目录 'baseUrl' => '@web/upload', //配置目录,注意前后加“/” 'CatalogFormat' => '/'.date('Y/m/d').'/', //允许上传文件的格式 'allowtype' => ['gif', 'png', 'jpg','jpeg'], //上传文件大小限制 'maxsize' =>2000000, //保存后的图片名称是否随机true/false 'israndname' => true, ], //删除文件 'image-del' => [ 'class' => ImgdelAction::className(), //磁盘目录 'basePath' => '@webroot/upload', 'baseUrl' => '@web/upload', ], ]; }, (*8)

//调用方式,imageUrl为默认图地址 = \huanguang\image\UploadWidget::widget([ 'imageUrl' => [['id'=>1,'imgurl'=>'/2017/04/08/20170408032608_916.jpg'],['id'=>2,'imgurl'=>'/2017/04/08/20170408031527_697.jpg'],['id'=>3,'imgurl'=>'/2017/04/08/20170408031927_169.jpg']],//图片数据 'imgpath'=>'@web/upload',//磁盘目录 'title'=>'上传电脑中的图片',//标题 'imgtile'=>'images/sctp.jpg',//选择按钮背景图片 'buttonText'=>'',//选择按钮标题,此处为图片,默认为空 'fileNumLimit'=>10,//允许上传文件数量 'fileSizeLimit'=>512000000,//允许总的文件大小 'fileSingleSizeLimit'=>51200000,//允许单个文件上传大小 'chunkSize'=>524288,//分片大小 ]); ?>, (*9)

   //图片接收为img[],数组形式    //图片删除是没有数据库操作的,需另外增加, (*10)

The Versions

08/04 2017

dev-master

9999999-dev

多图上传插件

  Sources   Download

BSD-4-Clause

The Requires

 

by Avatar huanguang

extension yii2

08/04 2017

1.1.0

1.1.0.0

多图上传插件

  Sources   Download

BSD-4-Clause

The Requires

 

by Avatar huanguang

extension yii2

07/04 2017

1.0.1

1.0.1.0

基于cropper的一款头像上传yii2组件

  Sources   Download

BSD-4-Clause

The Requires

 

by Avatar huanguang

extension yii2

07/04 2017

1.0.0

1.0.0.0 https://github.com/huanguang/image

Yii2 huanguang image

  Sources   Download

MIT

The Requires

 

by terry water

yii2 image