本文整理汇总了PHP中Gdn_Format::spoilerHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_Format::spoilerHtml方法的具体用法?PHP Gdn_Format::spoilerHtml怎么用?PHP Gdn_Format::spoilerHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_Format
的用法示例。
在下文中一共展示了Gdn_Format::spoilerHtml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _doSpoilers_callback
protected function _doSpoilers_callback($matches)
{
$bq = $matches[1];
# trim one level of quoting - trim whitespace-only lines
$bq = preg_replace('/^[ ]*>![ ]?|^[ ]+$/m', '', $bq);
$bq = $this->runBlockGamut($bq);
# recurse
$bq = preg_replace('/^/m', " ", $bq);
# These leading spaces cause problem with <pre> content,
# so we need to fix that:
$bq = preg_replace_callback('{(\\s*<pre>.+?</pre>)}sx', array(&$this, '_doSpoilers_callback2'), $bq);
return "\n" . $this->hashBlock(Gdn_Format::spoilerHtml($bq)) . "\n\n";
}
示例2: doSpoiler
/**
* Renders spoilers.
*
* @param object $bbCode Instance of NBBC parsing
* @param int $action Value of one of NBBC's defined constants. Typically, this will be BBCODE_CHECK.
* @param string $name Name of the tag
* @param string $default Value of the _default parameter, from the $params array
* @param array $params A standard set parameters related to the tag
* @param string $content Value between the open and close tags, if any
*
* @return string HTML-formatted spoiler value
*/
public function doSpoiler($bbCode, $action, $name, $default, $params, $content)
{
return Gdn_Format::spoilerHtml($content);
}