Hiho, I use the ckeditor on my website for special textareas like forum or signatures. But I have a problem with the output. I use ZF2 and would like to use ZendMarkup to render the output bbcode back in html. But at every time I call $bbcode->render(...)
I got the error There is no Zend_Markup_Root markup.
The ZendMarkup is an extension inspired by the Zend_Markup from ZF1. But I can't find any thing on API or other guides. Does someone has any idea what as the problem is?

有帮助吗?

解决方案

The ZendMarkup library is very old (last update is 10 months ago!) so I wouldn't use such library. If you would like, I think I traced the error down.

On this line there is a reference to Zend_Markup_Root while that should be ZendMarkup\Renderer\Markup\Html\Root. Try to change that line and see what happens.

Another way is to replace the ZendMarkup library with another library which does work and is updated regularly. An example is Decoda. If you load mjohnson/decoda in your composer.json, you can use Decoda in your Zend Framework 2 application:

<?php
use Decoda\Decoda;

$parser = new Decoda($bbcode);
$html   = $parser->parse();

With tools like composer, there is no need to use solely Zend* components when there are better alternatives.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top