PHP code example of loveorigami / yii2-jsoneditor

1. Go to this page and download the library: Download loveorigami/yii2-jsoneditor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

loveorigami / yii2-jsoneditor example snippets


use lo\widgets\Jsoneditor;

Jsoneditor::widget(
    [
        'editorOptions' => [
            'modes' => ['code', 'form', 'text', 'tree', 'view'], // available modes
            'mode' => 'tree', // current mode
        ],
        'name' => 'editor', // input name. Either 'name', or 'model' and 'attribute' properties must be specified.
        'options' => [], // html options
    ]
)

    <?= $form->field($model,'name')->widget(Jsoneditor::className(),
        [
            'editorOptions' => [
				'modes' => ['code', 'form', 'text', 'tree', 'view'], // available modes
				'mode' => 'tree', // current mode
            ],
        ]
    ); 

php composer.phar