‪TYPO3CMS  ‪main
ExtbasePluginContentObject.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
24 
35 {
36  public function ‪render($conf = [])
37  {
38  $extbaseBootstrap = GeneralUtility::makeInstance(Bootstrap::class);
39  $extbaseBootstrap->setContentObjectRenderer($this->‪getContentObjectRenderer());
40  if ($this->cObj->getUserObjectType() === false) {
41  // Come here only if we are not called from $TSFE->processNonCacheableContentPartsAndSubstituteContentMarkers()!
42  $this->cObj->setUserObjectType(‪ContentObjectRenderer::OBJECTTYPE_USER);
43  }
44  ‪$request = $extbaseBootstrap->initialize($conf, $this->request);
45  $content = $extbaseBootstrap->handleFrontendRequest(‪$request);
46  // Rendering is deferred, as the action should not be cached, we pump this now to TSFE to be executed later-on
47  if ($this->cObj->doConvertToUserIntObject) {
48  $this->cObj->doConvertToUserIntObject = false;
49  // @todo: this should be removed in the future in TSFE to allow more "uncacheables" than USER_INTs
50  // also, the handleFrontendRequest() should return the full response in the future
51  $conf['userFunc'] = Bootstrap::class . '->run';
52  $this->cObj->setUserObjectType(‪ContentObjectRenderer::OBJECTTYPE_USER_INT);
53  $tsfe = $this->‪getTypoScriptFrontendController();
54  $substKey = 'INT_SCRIPT.' . $tsfe->uniqueHash();
55  $content = '<!--' . $substKey . '-->';
56  $tsfe->config['INTincScript'][$substKey] = [
57  'conf' => $conf,
58  'cObj' => serialize($this->cObj),
59  'type' => 'FUNC',
60  ];
61  } elseif (isset($conf['stdWrap.'])) {
62  // Only executed when the element is not converted to USER_INT
63  $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
64  }
65  $this->cObj->setUserObjectType(false);
66  return $content;
67  }
68 }
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\OBJECTTYPE_USER
‪const OBJECTTYPE_USER
Definition: ContentObjectRenderer.php:365
‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject\getContentObjectRenderer
‪getContentObjectRenderer()
Definition: AbstractContentObject.php:51
‪TYPO3\CMS\Extbase\ContentObject\ExtbasePluginContentObject
Definition: ExtbasePluginContentObject.php:35
‪TYPO3\CMS\Extbase\ContentObject
Definition: ExtbasePluginContentObject.php:18
‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject\$request
‪ServerRequestInterface $request
Definition: AbstractContentObject.php:37
‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject
Definition: AbstractContentObject.php:31
‪TYPO3\CMS\Frontend\ContentObject\AbstractContentObject\getTypoScriptFrontendController
‪getTypoScriptFrontendController()
Definition: AbstractContentObject.php:79
‪TYPO3\CMS\Extbase\Core\Bootstrap
Definition: Bootstrap.php:42
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
Definition: ContentObjectRenderer.php:102
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Extbase\ContentObject\ExtbasePluginContentObject\render
‪render($conf=[])
Definition: ExtbasePluginContentObject.php:36
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\OBJECTTYPE_USER_INT
‪const OBJECTTYPE_USER_INT
Definition: ContentObjectRenderer.php:359