tomaj/nette-rte-processor

2.1.2 2016-09-21 13:29 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:52:47 UTC


README

Build Status Dependency Status

Latest Stable Version Latest Unstable Version License

需求

nette-rte-processor 需要 PHP 5.3.0 或更高版本。

警告:大部分代码来自 TYPO3 t3lib 库! - 所以它并不那么优雅 ;-)

安装

安装 nette-rte-processor 最好的方式是使用 Composer

$ composer require tomaj/nette-rte-processor

背景

这个库在需要将 RTE 字段从 TYPO3 渲染到前端时非常有用。库使用 TYPO3 的代码将特殊标记从 RTE 转换为输出 HTML。

使用方法

您可以使用简单的静态函数

\Tomaj\RTEProcessor\TextFormatter::rteTransform($bodytext)

或创建助手函数在模板中使用

$template->addFilter('rtetransform', function($text) {
	return \Tomaj\RTEProcessor\TextFormatter::rteTransform($text);
});

仓库 http://github.com/tomaj/nette-rte-processor.