jinjie / codeeditorfield
Code editor field for SilverStripe
Installs: 19 255
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 1
Type:silverstripe-vendormodule
Requires
- php: >=7.1
- silverstripe/framework: ^4
This package is auto-updated.
Last update: 2024-11-22 18:37:37 UTC
README
Creates an Ace Code Editor (https://ace.c9.io/)
Installation
composer require jinjie/codeeditorfield
Usage
$fields->push(CodeEditorField::create('MyCode', 'Enter Source Code Here'));
Setting the Programming Language Mode
$fields->push($myCodeEditorField = CodeEditorField::create('MyCode', 'Enter Source Code Here')); // set mode to html $myCodeEditorField->setMode('ace/mode/html'); // or javascript $myCodeEditorField->setMode('ace/mode/javascript');
see resources/thirdparty/ace for available modes (mode-{language}.js)