Json Form
Json Form

Modification json object in form

Installation
The preferred way to install this extension is through composer.

Either add

    "require": {
    "keygenqt/yii2-json-form": "*"
}
of your composer.json file.
Example form
Example form code
    <?php $form = ActiveForm::begin(); ?>

<?= $form->field($model, 'json')->widget(JsonForm::class, [
    'order' => false,
    'autoincrement' => true,
    'placeholder' => [
        'key' => 'Object key',
        'value' => 'Object value (optional)',
    ],
]) ?>

<?= $form->field($model, 'integer')->textInput()->input('text', ['placeholder' => 'Integer']) ?>

<?= $form->field($model, 'email')->textInput()->input('email', ['placeholder' => 'Email']) ?>

<?= Html::submitButton('Submit', ['class' => 'btn btn-primary']) ?>

<?php ActiveForm::end(); ?>
May 29, 2020