承接 eddmash/yii2-clipboard 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eddmash/yii2-clipboard

Composer 安装命令:

composer require eddmash/yii2-clipboard

包简介

The Clipboard js extension for the Yii2 framework

README 文档

README

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.

Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

Either run

$ php composer.phar require eddmash/yii2-clipboard "@dev"

or add

"eddmash/yii2-clipboard": "@dev"

to the require section of your composer.json file.

Usage

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)

Learn more yii2-clipboard documentation

统计信息

  • 总下载量: 19.53k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2016-11-11