cyberitas/yii2-tinymce-processor
Composer 安装命令:
composer require cyberitas/yii2-tinymce-processor
包简介
Yii 2 extension providing WordPress-style text processing from a TinyMCE editor
README 文档
README
Yii 2 extension providing WordPress-style text processing from a TinyMCE editor.
Features
- Essence oEmbed processing
- Texturization, replicating
wptexturize() - Auto-paragraphing, replicating
wpautop() - HTMLPurifier filtering, via Yii's
HtmlPufirierhelper - Yii 2 asset bundle for easy editor insertion
Usage
composer require "cyberitas/yii2-tinymce-processor"
Processor
use Cyberitas\TinymceProcessor\TinymceProcessor; $tmp = new TinymceProcessor(['config' => [ 'autop' => true, 'essence' => true, 'purify' => [ 'purifierConfig' => [ 'Attr.EnableId' => true ] ], 'texturize' => [ 'leftDoubleQuote' => '«', 'rightDoubleQuote' => '»' ] ]]); $output = $tmp->process("This is some content from a TinyMCE editor.");
Asset Bundle
use Cyberitas\TinymceProcessor\Assets\TinymceAssets; use yii\helpers\Html; use yii\widgets\InputWidget; class TinymceWidget extends InputWidget { public function run() { TinymceAssets::register($this->view); $this->view->registerJs('tinymce.init({selector: "textarea"});'); echo Html::textarea($this->name, $this->value); } }
Copyright
Copyright © 2016 Cyberitas Technologies, LLC. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2016-04-06