定制 mackrais/yii2-btn-copy-html-block 二次开发

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

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

mackrais/yii2-btn-copy-html-block

Composer 安装命令:

composer require mackrais/yii2-btn-copy-html-block

包简介

Widget by clone html block yii2.

README 文档

README

Latest Stable Version Latest Unstable Version License Total Downloads Monthly Downloads Daily Downloads

NOTE: Widget should always be the block that we cloned.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mackrais/yii2-btn-copy-html-block "dev-master"

or

 composer require --prefer-dist mackrais/yii2-btn-copy-html-block "dev-master"

or add

"mackrais/yii2-btn-copy-html-block": "dev-master"

to the require section of your composer.json file.

Usage

   <div class="mr-color-input pull-left">
           <?= $form->field($model, 'colors[]')->textInput(['type'=>'color','class'=>'product-color-input '])->label(false) ?>
           <?= mackrais\copyblock\Widget::widget([
               'caption'=>'', // any text button
               'options'=>[
                 'class'=>'my-class', // Options yii\helpers\Html::a()
                 'classRemoveBtn' => 'my-class' // for example glyphicon glyphicon-trash
                ], // any text button
               'beforeInsertBlock'=>'beforeClone(event, $this, $cloneBlock)', // 
               'afterInsertBlock'=>'afterClone(event, $this, $cloneBlock, $tmpBlock)', // 
               'beforeDeleteBlock'=>'beforeDelete(event, $this, $block)', // 
               'afterDeleteBlock'=>'afterDelete(event, $this, $block)', // 
               'selectorCloneBlock'=>'.mr-color-input', // selector clone block
           ]) ?>
       </div>
       <div class="clearfix"></div>

Usage js events

    function beforeClone(event, $this, $cloneBlock) {
          console.log('Block ',$cloneBlock,' will be cloned!');
    }
    
    function afterClone(event, $this, $cloneBlock, $tmpBlock) {
          console.log('Block ',$tmpBlock,' was cloned!');
    }
    
    function beforeDelete(event, $this, $block) {
          console.log('Block ',$block, ' will be deleted!');
    }
    
    function afterDelete(event, $this, $block) {
          console.log('Block ',$block,' was deleted!');
    }

Result

Screenshot Screenshot

License

yii2-btn-copy-html-block is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD
  • 更新时间: 2017-05-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固