2017 © Pedro Peláez
 

yii2-extension yii2-avatar

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

image

hyii2/yii2-avatar

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

  • Monday, August 1, 2016
  • by yii-china.com
  • Repository
  • 5 Watchers
  • 24 Stars
  • 443 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 2 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

头像上传

基于cropper的一款头像上传yii2组件,, (*1)

@from Yii中文网(www.yii-china.com), (*2)

Installation

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

Either run, (*4)

php composer.phar require --prefer-dist hyii2/yii2-avatar "dev-master"

or add, (*5)

"hyii2/yii2-avatar": "dev-master"

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

Usage

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


//在当前控制器的actions中添加如下配置 public function actions() { return [ 'crop'=>[ 'class' => 'hyii2\avatar\CropAction', 'config'=>[ 'bigImageWidth' => '200', //大图默认宽度 'bigImageHeight' => '200', //大图默认高度 'middleImageWidth'=> '100', //中图默认宽度 'middleImageHeight'=> '100', //中图图默认高度 'smallImageWidth' => '50', //小图默认宽度 'smallImageHeight' => '50', //小图默认高度 //头像上传目录(注:目录前不能加"/") 'uploadPath' => 'uploads/avatar', ] ] ]; } //调用方式,imageUrl为默认图地址 = \hyii2\avatar\AvatarWidget::widget(['imageUrl'=>'/statics/images/avatar/avatar_1.jpg']); ?>

The Versions

01/08 2016

dev-master

9999999-dev

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

  Sources   Download

BSD-4-Clause

The Requires

 

by Xianan Huang

extension yii2

01/08 2016

dev-dev

dev-dev

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

  Sources   Download

BSD-4-Clause

The Requires

 

by Xianan Huang

extension yii2