kevingroeger/codeeditorfield

适用于 SilverStripe 4 和 5 的代码编辑器字段

安装次数: 3,643

依赖者: 1

建议者: 0

安全性: 0

星标: 1

关注者: 1

分支: 0

公开问题: 0

类型:silverstripe-vendormodule

1.3 2024-03-20 09:58 UTC

This package is auto-updated.

Last update: 2024-09-20 11:24:29 UTC


README

创建 Ace 代码编辑器 (https://ace.c9.io/)

需求

  • Silverstripe 4+ 或 5+
  • PHP 8+

安装

composer require kevingroeger/codeeditorfield

用法

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

主题和模式

有关可用模式和主题的信息,请参阅 resources/thirdparty/ace

贡献

鸣谢

两者都已停止开发,但此包高度受到这两位优秀工作的启发!