Skip to content

Latest commit

 

History

History
48 lines (28 loc) · 1.15 KB

File metadata and controls

48 lines (28 loc) · 1.15 KB

Code Editor Field for SilverStripe

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

Feel free to contribute, ask questions or report issues!

Requirements

  • Silverstripe 4 - 6
  • 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!