本文整理汇总了PHP中NNText::getBody方法的典型用法代码示例。如果您正苦于以下问题:PHP NNText::getBody方法的具体用法?PHP NNText::getBody怎么用?PHP NNText::getBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NNText
的用法示例。
在下文中一共展示了NNText::getBody方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterRender
public function onAfterRender()
{
// only in html and feeds
if (JFactory::getDocument()->getType() !== 'html' && JFactory::getDocument()->getType() !== 'feed') {
return;
}
$html = JResponse::getBody();
if ($html == '') {
return;
}
if (JFactory::getDocument()->getType() != 'html') {
$this->helpers->get('replace')->replaceTags($html, 'body');
$this->helpers->get('clean')->cleanLeftoverJunk($html);
JResponse::setBody($html);
return;
}
// only do stuff in body
list($pre, $body, $post) = NNText::getBody($html);
$this->helpers->get('replace')->replaceTags($body, 'body');
$html = $pre . $body . $post;
$this->helpers->get('clean')->cleanLeftoverJunk($html);
// replace head with newly generated head
// this is necessary because the plugins might have added scripts/styles to the head
$this->helpers->get('head')->updateHead($html);
JResponse::setBody($html);
}
示例2: onAfterRender
public function onAfterRender()
{
// only in html and feeds
if (JFactory::getDocument()->getType() !== 'html' && !NNFrameworkFunctions::isFeed()) {
return;
}
$html = JResponse::getBody();
if ($html == '') {
return;
}
if (NNFrameworkFunctions::isFeed()) {
$this->replaceTags($html);
} else {
// only do stuff in body
list($pre, $body, $post) = NNText::getBody($html);
$this->replaceTags($body);
$html = $pre . $body . $post;
}
$this->cleanLeftoverJunk($html);
JResponse::setBody($html);
}
示例3: onAfterRender
/**
* onAfterRender
*/
public function onAfterRender()
{
// only in html and feeds
if (JFactory::getDocument()->getType() !== 'html' && JFactory::getDocument()->getType() !== 'feed') {
return;
}
// Grab the body (but be gentle)
$html = JResponse::getBody();
if ($html == '') {
return;
}
list($pre, $body, $post) = NNText::getBody($html);
$this->protect($body);
$this->replaceInTheRest($body);
NNProtect::unprotect($body);
$this->cleanTagsFromHead($pre);
$html = $pre . $body . $post;
$this->cleanLeftoverJunk($html);
// Throw the body back (less gentle)
JResponse::setBody($html);
}