本文整理汇总了PHP中XenForo_BbCode_Formatter_Base::renderTree方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_BbCode_Formatter_Base::renderTree方法的具体用法?PHP XenForo_BbCode_Formatter_Base::renderTree怎么用?PHP XenForo_BbCode_Formatter_Base::renderTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_BbCode_Formatter_Base
的用法示例。
在下文中一共展示了XenForo_BbCode_Formatter_Base::renderTree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderTree
public function renderTree(array $tree, array $extraStates = array())
{
if (empty($extraStates['states'])) {
$extraStates['states'] = array();
}
return parent::renderTree($tree, $extraStates);
}
示例2: render
/**
* Renders the given text containing BB codes to the required output format
* (dependent on the given tags).
*
* @param string|array $text If array, is assumed to be an already parsed version
* @param array $extraStates A list of extra states to pass into the formatter
*
* @return string
*/
public function render($text, array $extraStates = array())
{
//echo '<pre>' . htmlspecialchars($text) . '</pre>';
if (is_array($text)) {
$parsed = $text;
} else {
$parsed = $this->parse($text);
}
return $this->_formatter->renderTree($parsed, $extraStates);
}
示例3: renderTree
public function renderTree(array $tree, array $extraStates = array())
{
$output = parent::renderTree($tree, $extraStates);
$maskModel = XenForo_Model::create('ThemeHouse_ImageRestrict_Model_Mask');
$maskedUrls = $maskModel->maskUrls($this->_urls, $extraStates);
foreach ($this->_urls as $url => $validUrl) {
$search = $this->_urlPrefix . $url . $this->_urlSuffix;
if (!empty($maskedUrls[$validUrl])) {
$replace = $maskedUrls[$validUrl];
} else {
$replace = $url;
}
$output = str_replace($search, $replace, $output);
}
return $output;
}