PHP code example of cacko / yii2-widget-monaco

1. Go to this page and download the library: Download cacko/yii2-widget-monaco 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/ */

    

cacko / yii2-widget-monaco example snippets



use Cacko\Yii2\Widgets\MonacoEditor\Widget\Editor as MonacoEditor;

<?= $form->field($model, 'script')->widget(MonacoEditor::class)->label(t('Code')) 

 use Cacko\Yii2\Widgets\MonacoEditor\Widget\Editor as MonacoEditor;

 <?= MonacoEditor::widget([
     'model' => $model,
     'attribute' => 'script',
     'language' => 'javascript',
 ]) 

 use Cacko\Yii2\Widgets\MonacoEditor\Widget\Editor as MonacoEditor;

 <?= MonacoEditor::widget([
     'name' => 'script',
     'language' => 'javascript',
 ]) 


use Cacko\Yii2\Widgets\MonacoEditor\Widget\DiffEditor as MonacoDiffEditor;

<?= MonacoDiffEditor::widget([
    'model' => $model,
    'parent' => $parent,
    'attribute' => $attribute,
]) 

\Yii::$container->set(EditorSettingsInterface::class, MyAmazingShite::class);