b-khouy / yaml_editor
此包的最新版本(2.0.0)没有可用的许可信息。
为YAML配置文本区域添加编辑器
2.0.0
2023-07-17 21:25 UTC
This package is not auto-updated.
Last update: 2024-09-25 01:20:06 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
属性的模块
贡献 🔨
欢迎提交拉取请求和星标。对于错误和功能请求,请创建一个问题。