当前位置: 首页>>代码示例>>PHP>>正文


PHP nnText::getBody方法代码示例

本文整理汇总了PHP中nnText::getBody方法的典型用法代码示例。如果您正苦于以下问题:PHP nnText::getBody方法的具体用法?PHP nnText::getBody怎么用?PHP nnText::getBody使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nnText的用法示例。


在下文中一共展示了nnText::getBody方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
 }
开发者ID:naka211,项目名称:studiekorrektur,代码行数:26,代码来源:helper.php

示例2: 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);
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:24,代码来源:helper.php

示例3: onAfterRender

 function onAfterRender()
 {
     // only in html
     if (JFactory::getDocument()->getType() !== 'html' && JFactory::getDocument()->getType() !== 'feed') {
         return;
     }
     $html = JResponse::getBody();
     if ($html == '') {
         return;
     }
     if (strpos($html, '{' . $this->params->tag) === false) {
         if (!$this->params->hasitems) {
             // remove style and script if no items are found
             $html = preg_replace('#\\s*<' . 'link [^>]*href="[^"]*/(tooltips/css|css/tooltips)/[^"]*\\.css[^"]*"[^>]* />#s', '', $html);
             $html = preg_replace('#\\s*<' . 'script [^>]*src="[^"]*/(tooltips/js|js/tooltips)/[^"]*\\.js[^"]*"[^>]*></script>#s', '', $html);
             $html = preg_replace('#/\\* START: Tooltips .*?/\\* END: Tooltips [a-z]* \\*/\\s*#s', '', $html);
         }
     } else {
         // only do stuff in body
         list($pre, $body, $post) = nnText::getBody($html);
         $this->protect($body);
         $this->replaceTags($body);
         $html = $pre . $body . $post;
         $this->unprotect($html);
     }
     $this->cleanLeftoverJunk($html);
     JResponse::setBody($html);
 }
开发者ID:ngogiangthanh,项目名称:damtvnewversion,代码行数:28,代码来源:helper.php

示例4: onAfterRender

 function onAfterRender()
 {
     // not in pdf's
     if (JFactory::getDocument()->getType() == 'pdf') {
         return;
     }
     $html = JResponse::getBody();
     if ($html == '') {
         return;
     }
     if (JFactory::getDocument()->getType() != 'html') {
         $this->replaceTags($html);
         $this->cleanLeftoverJunk($html);
     } else {
         // only do stuff in body
         list($pre, $body, $post) = nnText::getBody($html);
         $this->protect($body);
         $this->replaceTags($body);
         $html = $pre . $body . $post;
         $this->cleanLeftoverJunk($html);
         NNProtect::unprotect($html);
         // replace head with newly generated head
         // this is necessary because the plugins might have added scripts/styles to the head
         $orig_document = clone JFactory::getDocument();
         $this->updateHead($html, $orig_document);
         unset($orig_document);
     }
     JResponse::setBody($html);
 }
开发者ID:naka211,项目名称:jydsk,代码行数:29,代码来源:helper.php

示例5: onAfterRender

	function onAfterRender()
	{
		// not in pdf's
		if (JFactory::getDocument()->getType() == 'pdf')
		{
			return;
		}

		$html = JResponse::getBody();
		if ($html == '')
		{
			return;
		}

		if (JFactory::getDocument()->getType() != 'html')
		{
			$this->replaceTags($html);
		}
		else
		{
			// only do stuff in body
			list($pre, $body, $post) = nnText::getBody($html);
			$this->protect($body);
			$this->replaceTags($body);
			$html = $pre . $body . $post;
		}

		$this->cleanLeftoverJunk($html);
		NNProtect::unprotect($html);

		JResponse::setBody($html);
	}
开发者ID:sergy444,项目名称:joomla,代码行数:32,代码来源:helper.php

示例6: onAfterRender

 function onAfterRender()
 {
     // only in html and feeds
     if (JFactory::getDocument()->getType() !== 'html' && ($this->params->protect_in_feeds && JFactory::getDocument()->getType() !== 'feed')) {
         return;
     }
     $html = JResponse::getBody();
     if ($html == '') {
         return;
     }
     // only do stuff in body
     list($pre, $body, $post) = nnText::getBody($html);
     $this->protectEmails($body);
     $html = $pre . $body . $post;
     if (JFactory::getDocument()->getType() == 'html') {
         if (strpos($html, 'addCloakedMailto') === false) {
             // remove style and script if no emails are found
             $html = preg_replace('#/\\* START: ' . $this->name . ' .*?/\\* END: ' . $this->name . ' [a-z]* \\*/\\s*#s', '', $html);
         } else {
             // correct attribut ids in possible cached modules/content
             $html = preg_replace('# data-ep-a[a-z0-9]{4}=#s', ' ' . $this->params->atrr_pre . '=', $html);
             $html = preg_replace('# data-ep-b[a-z0-9]{4}=#s', ' ' . $this->params->atrr_post . '=', $html);
             NNProtect::removeInlineComments($html, $this->name);
         }
     }
     JResponse::setBody($html);
 }
开发者ID:SheffieldWalkingGroup,项目名称:swgwebsite,代码行数:27,代码来源:helper.php


注:本文中的nnText::getBody方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。