PHP code example of bestyii / yii2-clipboardjs

1. Go to this page and download the library: Download bestyii/yii2-clipboardjs library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bestyii / yii2-clipboardjs example snippets


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

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