yii2-clipboard A Yii2 extension that makes it easy to copy input item value on to clipboard.

Installation ΒΆ

The preferred way to install this extension is through composer.

$ composer require eddmash/yii2-clipboard "@dev"

You can use the widget which create a input that has copy button.

echo \Eddmash\Clipboard\Clipboard::widget([
    'model' => $model,
    'attribute' => 'email',
    'options'=>['readonly'=>""]
]); 

Or if you need to use it without a model. The Clipboard::input() method is works like HTML::tag() actually its use it to create its output. The only difference is that it takes the first argument as the view object on which the output is being done.

$url = "https://packagist.org/packages/eddmash/yii2-clipboard";
Clipboard::input($this, 'text', 'url', $url, ['id' => 'url', 'readonly' => true])

Or if simply need the composer.js loaded on a view

\Eddmash\Clipboard\ClipboardAsset::register($this)
1 0
2 followers
0 downloads
Yii Version: 2.0
License: MIT
Category: Others
Developed by: eddmash
Created on: Sep 12, 2017
Last updated: 6 years ago

Related Extensions