承接 bestyii/yii2-clipboardjs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bestyii/yii2-clipboardjs

最新稳定版本:2.0.1

Composer 安装命令:

composer require bestyii/yii2-clipboardjs

包简介

README 文档

README

基于Clipboardjs 实现一键复制内容到剪贴板.

Clipboardjs 是纯JavaScript实现的.

安装 Installation

通过 composer安装扩展. 添加下面代码到项目的 composer.json文件中

"bestyii/yii2-clipboardjs":"*",

使用 Usage

//渲染带输入框的控件
<?= \bestyii\clipboardjs\ClipboardInputWidget::widget([
            'text' => 'https://www.bestyii.com',
             'label' => '复制到剪贴板',
             'successText' => '复制成功!',
        ]) ?>

//按钮形式
<?= \bestyii\clipboardjs\ClipboardJsWidget::widget([
    'text' => "Hello World",
    // 'label' => 'Copy to clipboard',
    // 'htmlOptions' => ['class' => 'btn'],
    // 'tag' => 'button',
]) ?>

//点击按钮复制指定id的input值
<?= \bestyii\clipboardjs\ClipboardJsWidget::widget([
    'inputId' => "#input-url",
    // 'cut' => false, // Cut the text out of the input instead of copy?
    // 'label' => 'Copy to clipboard',
    // 'htmlOptions' => ['class' => 'btn'],
    // 'tag' => 'button',
]) ?>

直接调用静态资源 Just the Asset?

Yes, you can use just the asset.

 \bestyii\clipboardjs\ClipboardJsAsset::register($view);

It will auto init anything with the "clipboard-js-init" class.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-08-28