PHP code example of kevingroeger / codeeditorfield

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

    

kevingroeger / codeeditorfield example snippets


$codeEditor = CodeEditorField::create('Title', 'Enter Source Code Here');

// set mode to html (default is json)
$codeEditor->setMode('ace/mode/html');

// set mode to github (default is monokai)
$codeEditor->setTheme('ace/theme/github');

$fields->addFieldsToTab('Root.Main', [
    $codeEditor
]);