maxime-rainville/silverstripe-copy-field

A field with a simple copy button

Installs: 43

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 0

Open Issues: 5

Language:JavaScript

Type:silverstripe-vendormodule

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)
    ]
);