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


PHP ContentObjectRenderer::getUserObjectType方法代码示例

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


在下文中一共展示了ContentObjectRenderer::getUserObjectType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructs a new \EssentialDots\ExtbaseHijax\Event\Listener.
  *
  * @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer		$cObj	 	An array of parameters
  */
 public function __construct($cObj = null)
 {
     $this->cObj = $cObj;
     $reset = true;
     $this->userObjectType = $this->cObj->getUserObjectType();
     if ($this->cObj && $this->cObj->currentRecord) {
         list($table, $uid) = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(':', $this->cObj->currentRecord);
         if ($table == 'tt_content' && $uid) {
             $this->data = $this->cObj->data;
             list($this->table) = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(':', $this->cObj->currentRecord);
             $reset = false;
         }
     }
     if ($reset) {
         $this->data = $this->cObj && $this->cObj->data ? $this->cObj->data : array();
         $this->table = '';
         $this->cObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
         $this->cObj->start($this->data, $this->table);
     }
 }
开发者ID:seitenarchitekt,项目名称:extbase_hijax,代码行数:25,代码来源:CObj.php

示例2: render

 /**
  * Renders FlashMessages and flushes the FlashMessage queue
  * Note: This disables the current page cache in order to prevent FlashMessage output
  * from being cached.
  *
  * @see \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::no_cache
  * @param string $renderMode one of the RENDER_MODE_* constants
  * @return string rendered Flash Messages, if there are any.
  * @api
  */
 public function render($renderMode = self::RENDER_MODE_UL)
 {
     $flashMessages = $this->controllerContext->getFlashMessageQueue()->getAllMessagesAndFlush();
     if ($flashMessages === NULL || count($flashMessages) === 0) {
         return '';
     }
     if (isset($GLOBALS['TSFE']) && $this->contentObject->getUserObjectType() === \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::OBJECTTYPE_USER) {
         $GLOBALS['TSFE']->no_cache = 1;
     }
     switch ($renderMode) {
         case self::RENDER_MODE_UL:
             return $this->renderUl($flashMessages);
         case self::RENDER_MODE_DIV:
             return $this->renderDiv($flashMessages);
         default:
             throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('Invalid render mode "' . $renderMode . '" passed to FlashMessageViewhelper', 1290697924);
     }
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:28,代码来源:FlashMessagesViewHelper.php


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