20minutes/php-draftjs-html
最新稳定版本:v1.0.3
Composer 安装命令:
composer require 20minutes/php-draftjs-html
包简介
Export Draft.js ContentState to HTML
README 文档
README
Export DraftJS ContentState to HTML from PHP
Installation
$ docker-compose build $ docker-compose composer
Usage
<?php namespace Tests; use Willtj\PhpDraftjsHtml\Converter; use Prezly\DraftPhp\Converter as DraftConverter; // From a JSON string $contentState = DraftConverter::convertFromJson($input); $converter = new Converter; $result = $converter ->setState($contentState) ->toHtml();
Basic customisation can be carried out by overriding the default style map, eg
$converter->updateStyleMap(['BOLD' => ['element' => 'b']]);
The class can be extended for more advanced custom rendering.
Tests
$ docker-compose phpunit
统计信息
- 总下载量: 30.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-15