maxime-rainville/silverstripe-copy-field

A field with a simple copy button

Installs: 8

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:silverstripe-vendormodule

0.0.1 2021-10-06 13:43 UTC

This package is auto-updated.

Last update: 2021-11-06 14:00:57 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)
    ]
);