dev-dev
dev-dev
BSD-3-Clause
The Requires
- php >=5.4.0
- yiisoft/yii2 *
- zenorocha/clipboard.js dev-master
by Wil Wade
dev-master
9999999-dev
BSD-3-Clause
The Requires
- php >=5.4.0
- yiisoft/yii2 *
- bower-asset/clipboard ^1.5
by Wil Wade
An easy way to use Clipboardjs in your project. Clipboardjs is a javascript only way to copy text to the clipboard., (*1)
Install this extension via composer. Add this line to your project’s composer.json, (*2)
"supplyhog/yii2-clipboardjs" : "dev-master"
//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', ]) ?>
Yes, you can use just the asset. php \supplyhog\ClipboardJs\ClipboardJsAsset::register($view)
It will auto init anything with the "clipboard-js-init" class., (*3)
BSD-3-Clause
BSD-3-Clause