bywatersolutions/silverstripe-jsoneditorfield
Composer 安装命令:
composer require bywatersolutions/silverstripe-jsoneditorfield
包简介
JSON Editor Field for Silverstripe
README 文档
README
Add a JSON Schema-based Editor to SilverStripe. Uses JSON Editor to build an interactive form for building JSON that's valid according to a provided schema.
Installation
composer require bywatersolutions/silverstripe-jsoneditorfield
Usage
use ByWaterSolutions\JsonEditorField\JsonEditorField;
...
private static $db = array[
'MyJson' => 'Text'
];
public function getCMSFields() {
$fields = parent::getCMSFields();
$schema = file_get_contents("path/to/your/schema.json");
$fields->addFieldToTab("Root.Main", new JsonEditorField("MyJson", "My JSON Document", $this->MyJson, null, $schema));
return $fields;
}
It's that easy! Of course, you still have to write the JSON Schema and make sure it's valid.... check the console on your browser if you're not getting the form you expected.
统计信息
- 总下载量: 33
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2019-11-15