PHP code example of schoolspider / spider-editor

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

    

schoolspider / spider-editor example snippets


$editor = new SchoolSpider\SpiderEditor\Editor();
$editor->setContent([
    [
        'type' => 'heading',
        'level' => 1,
        'content' => 'This is my heading',
    ],
    [
        'type' => 'content',
        'content' => '<p>This is my content</p>',
    ],
]);

$html = $editor->toHTML();
// <h1>This is my heading</h1><p>This is my content</p>