定制 xtarantulz/yii2-input-img-preview 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xtarantulz/yii2-input-img-preview

Composer 安装命令:

composer require xtarantulz/yii2-input-img-preview

包简介

Розширение для yii2-elfinder input, чтобы отображать превью выбраных файлов + fancybox

README 文档

README

The module is expansion ElFinder Input. If you use a text field to add pictures displayed thumbs.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist xtarantulz/yii2-input-img-preview "dev-master"

or add

"xtarantulz/yii2-input-img-preview": "dev-master"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

use mihaildev\elfinder\InputFile;
use mihaildev\elfinder\ElFinder;
use xtarantulz\preview\PreviewAsset;
PreviewAsset::register($this);

echo $form->field($model, 'images')->widget(InputFile::className(), [
    'language'      => 'ru',
    'controller'    => 'elfinder', // вставляем название контроллера, по умолчанию равен elfinder
    'filter'        => 'image',    // фильтр файлов, можно задать массив фильтров https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#wiki-onlyMimes
    'template'      => '<div class="input-group">{input}<span class="input-group-btn">{button}</span></div>',
    'options'       => ['class' => 'form-control img'],
    'buttonOptions' => ['class' => 'btn btn-success'],
    'multiple'      => true       // возможность выбора нескольких файлов
]);

Screenshot

screen-shot

统计信息

  • 总下载量: 1.17k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: JavaScript

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2016-03-23