hector-del-rio/yii2-image-up
最新稳定版本:1.0.0
Composer 安装命令:
composer require hector-del-rio/yii2-image-up
包简介
Image upload and preview for yii2 models using yii2-upload-behavior extension.
README 文档
README
Simple and responsive image upload and preview for yii2 models using yii2-upload-behavior extension.
When using this extension in your ActiveForm an image preview of the specified attribute will be shown along with a button to change it.
When a new image is selected, the preview will show the new image.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist hector-del-rio/yii2-image-up "^1.0.0"
or add
"hector-del-rio/yii2-image-up": "^1.0.0"
to the require section of your composer.json file.
Requirements
This extension builds up on top of yii-dream-team/yii2-upload-behavior's class ImageUploadBehavior. You must follow the instructions on how to use this module, which can be found here.
Usage
In your view:
<?= $form->field($model, 'photo')->widget(hectordelrio\imageUp\ImageUp::className()); ?>
Options
The following options are available to configure:
- thumbsEnabled: whether thumbs should be shown instead of original size images. The widget will enable thumbs only if they can be found.
- thumbProfileName: the thumb profile name as specified in
ImageUploadBehaviorconfiguration. Defaults to "thumb". - options: the options to be passed to the
Html::activeFileInput()function. More info can be found here - previewOptions: the options to be passed to the
Html::img()function. More info can be found here
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-13
