dmstr / yii2-json-editor

Yii2 wrapper for "json-editor/json-editor" (is a fork of "jdorn/json-editor").
BSD 2-Clause "Simplified" License
8 stars 9 forks source link

Added the option to disable a editor via property #31

Closed eluhr closed 2 years ago

eluhr commented 2 years ago

Added the option to disable an editor widget via a property. By default it is set to false to allow backward compatibility.

Ref.: https://github.com/json-editor/json-editor#enable-and-disable-the-editor

Example:

<?php
use dmstr\jsoneditor\JsonEditorWidget;

echo JsonEditorWidget::widget([
  'schema' => [],
  'model' => $model,
  'attribute' => 'myproperty',
  'disabled' => true // A brand new disable property 🎉
]);
?>