1. Go to this page and download the library: Download megasteve19/editorjs 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/ */
megasteve19 / editorjs example snippets
use Megasteve19\EditorJS\EditorJS;
$editorJS = new EditorJS( $json, $config );
$editorJS = new EditorJS($json, $config);
// Create a new block
$newBlockData = new \Megasteve19\EditorJS\Blocks\Block([
'type' => 'header',
'data' => [
'text' => 'Hello World',
'level' => 1
]
]);
// Push the new block to the collection
$editorJS->collection->insert($newBlock);