supplyhog/yii2-clipboardjs
Composer 安装命令:
composer require supplyhog/yii2-clipboardjs
包简介
README 文档
README
An easy way to use Clipboardjs in your project. Clipboardjs is a javascript only way to copy text to the clipboard.
Installation
Install this extension via composer. Add this line to your project’s composer.json
"supplyhog/yii2-clipboardjs" : "dev-master"
Usage
//Button to copy text <?= \supplyhog\ClipboardJs\ClipboardJsWidget::widget([ 'text' => "Hello World", // 'label' => 'Copy to clipboard', // 'htmlOptions' => ['class' => 'btn'], // 'tag' => 'button', ]) ?> //Button to copy text from input id <?= \supplyhog\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. php \supplyhog\ClipboardJs\ClipboardJsAsset::register($view) It will auto init anything with the "clipboard-js-init" class.
统计信息
- 总下载量: 125.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2016-03-18