kevingroeger/codeeditorfield

Code editor field for SilverStripe 4 and 5

Installs: 3 918

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

1.3 2024-03-20 09:58 UTC

This package is auto-updated.

Last update: 2024-12-20 11:48:01 UTC


README

Creates an Ace Code Editor (https://ace.c9.io/)

Requirements

  • Silverstripe 4+ or 5+
  • PHP 8+

Installation

composer require kevingroeger/codeeditorfield

Usage

$codeEditor = CodeEditorField::create('Title', 'Enter Source Code Here');

// set mode to html (default is json)
$codeEditor->setMode('ace/mode/html');

// set mode to github (default is monokai)
$codeEditor->setTheme('ace/theme/github');

$fields->addFieldsToTab('Root.Main', [
    $codeEditor
]);

Themes & Modes

For available modes and themes, see resources/thirdparty/ace

Contribute

Credits

Both have stopped development, but this package is highly inspired by the great work of these two!