本文整理汇总了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);
}
}
示例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);
}
}