2017 © Pedro Peláez
 

library yii2-clipboardjs

image

supplyhog/yii2-clipboardjs

  • Thursday, June 7, 2018
  • by devsupplyhog
  • Repository
  • 2 Watchers
  • 7 Stars
  • 14,542 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 2 Versions
  • 11 % Grown

The README.md

yii2-clipboardjs

An easy way to use Clipboardjs in your project. Clipboardjs is a javascript only way to copy text to the clipboard., (*1)

Installation

Install this extension via composer. Add this line to your project’s composer.json, (*2)

"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., (*3)

The Versions

07/06 2018

dev-dev

dev-dev

  Sources   Download

BSD-3-Clause

The Requires

 

by Wil Wade

31/10 2016

dev-master

9999999-dev

  Sources   Download

BSD-3-Clause

The Requires

 

by Wil Wade