maxime-rainville/silverstripe-copy-field

A field with a simple copy button

Maintainers

Package info

github.com/maxime-rainville/silverstripe-copy-field

Language:JavaScript

Type:silverstripe-vendormodule

pkg:composer/maxime-rainville/silverstripe-copy-field

Statistics

Installs: 43

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 5

0.0.1 2021-10-06 13:43 UTC

README

This module provides a CopyField for Silverstripe CMS. The CopyField includes a copy button to make it easy to copy the value of the field to the clipboard.

image

Installation

composer require maxime-rainville/silverstripe-copy-field

Usage

The CopyField defaults to being read only. If you want to hide the value, you can use the setObfuscate method on the CopyField to get it to render as a password.

use MaximeRainville\CopyField\CopyField;

...

$fields->addFieldsToTab(
    'Root.Main',
    [
        CopyField::create('APIKey', 'API Key', $this->Key),
        CopyField::create('APISecret', 'API Secret', $this->Secret)->setObfuscate(true)
    ]
);