8000 GitHub - InWorldLTD/editorjs-php: PHP SDK for the https://editorjs.io editor
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

InWorldLTD/editorjs-php

 
 

Repository files navigation

PHP library for easing your development with the EditorJS

Latest Version Software License Build Status Code Coverage Mutation testing

Installation

composer require setono/editorjs-php

Usage

Here is a full example going from json to html output.

<?php
use Setono\EditorJS\Parser\Parser;
use Setono\EditorJS\Renderer\Renderer;

$json = '...'; // this is the actual json you receive from the EditorJS instance

$parser = new Parser();
$parserResult = $parser->parse($json);

$renderer = new Renderer();
$renderer->add(new DelimiterBlockRenderer());
$renderer->add(new HeaderBlockRenderer());
$renderer->add(new ImageBlockRenderer());
$renderer->add(new ListBlockRenderer());
$renderer->add(new ParagraphBlockRenderer());
$renderer->add(new RawBlockRenderer());

$html = $renderer->render($parserResult);

EditorJS plugins supported

A PR adding support for any of the above plugins would be awesome! Thank you 🎉

Releases

No releases published

Packages

No packages published

Languages

  • PHP 93.2%
  • HTML 6.8%
0