voidagency / yaml_editor
此包的最新版本(2.0.0)没有可用的许可证信息。
为 YAML 配置文本区域添加了编辑器
2.0.0
2024-01-15 08:44 UTC
README
此模块为所有具有
data-yaml-editor
属性的 textarea 加载了 Ace 编辑器
演示 📺
用法 ☝️
字段小部件
您可以使用 YAML 编辑器为 文本(纯文本,长文本) 字段,只需转到 管理表单显示 并选择 带 YAML 编辑器的文本区域。
代码
当您需要为您的 YAML 文件添加编辑器时,请将 data-yaml-editor
添加到您的 textarea,如下所示:
$form['config'] = [ '#type' => 'textarea', '#title' => t('Configuration'), '#attributes' => ['data-yaml-editor' => 'true'], ];
支持者 😇
以下是一些已实现 data-yaml-editor
属性的模块
贡献 🔨
欢迎提交拉取请求和星标。对于错误和功能请求,请创建一个问题。