PHP code example of kochiro / yii2-codemirror

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

    

kochiro / yii2-codemirror example snippets

 

use kochiro\codemirror\CodeMirror; 

// set the mode based on the available options in assets/mode
$mode = 'application/x-httpd-php';

echo $form->field($file, 'description')->widget(CodeMirror::className(), [
    'id' => $file->id,
    'name' => '[description][]'.$id,
	'value' => $file->description,
    'mode' => $mode,
    'htmlOptions' => [
        "id"=>'description_'.$file->id, 
        "theme"=>'solarized dark' // set the theme based on the options in assets/theme, you must also