‪TYPO3CMS  11.5
LinkHandlingController.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 
20 use Psr\Http\Message\ServerRequestInterface;
23 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
24 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Internal\ArrayValueInstruction;
25 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\RequestBootstrap;
26 
31 {
35  protected ?ContentObjectRenderer ‪$cObj = null;
36 
42  public function ‪setContentObjectRenderer(ContentObjectRenderer ‪$cObj): void
43  {
44  $this->cObj = ‪$cObj;
45  }
46 
50  public function ‪mainAction(): string
51  {
52  $instruction = RequestBootstrap::getInternalRequest()
53  ->getInstruction(LinkHandlingController::class);
54  if (!$instruction instanceof ArrayValueInstruction) {
55  return '';
56  }
57  return $this->cObj->cObjGet($instruction->getArray());
58  }
59 
65  public function ‪dumpPageArgumentsAction(?string $content, array $configuration = null): string
66  {
68  $request = ‪$GLOBALS['TYPO3_REQUEST'];
70  $pageArguments = $request->getAttribute('routing');
72  $language = $request->getAttribute('language');
73  $flags = 0;
74  if ($configuration['userFunc.']['prettyPrint'] ?? true) {
75  $flags += JSON_PRETTY_PRINT;
76  }
77  return json_encode([
78  'pageId' => $pageArguments->getPageId(),
79  'pageType' => $pageArguments->getPageType(),
80  'languageId' => $language->getLanguageId(),
81  'staticArguments' => $pageArguments->getStaticArguments(),
82  'routeArguments' => $pageArguments->getRouteArguments(),
83  'dynamicArguments' => $pageArguments->getDynamicArguments(),
84  'queryArguments' => $pageArguments->getQueryArguments(),
85  'requestQueryParams' => $request->getQueryParams(),
86  '_GET' => $_GET,
87  ], $flags);
88  }
89 }
‪TYPO3\CMS\Core\Routing\PageArguments
Definition: PageArguments.php:26
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage
Definition: SiteLanguage.php:26
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Fixtures
Definition: LinkHandlingController.php:18