‪TYPO3CMS  9.5
LinkHandlingController.php
Go to the documentation of this file.
1 <?php
2 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 
18 use Psr\Http\Message\ServerRequestInterface;
22 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Internal\ArrayValueInstruction;
23 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\RequestBootstrap;
24 
29 {
33  public ‪$cObj;
34 
38  public function ‪mainAction(): string
39  {
40  $instruction = RequestBootstrap::getInternalRequest()
41  ->getInstruction(LinkHandlingController::class);
42  if (!$instruction instanceof ArrayValueInstruction) {
43  return '';
44  }
45  return $this->cObj->cObjGet($instruction->getArray());
46  }
47 
53  public function ‪dumpPageArgumentsAction(?string $content, array $configuration = null): string
54  {
56  $request = ‪$GLOBALS['TYPO3_REQUEST'];
58  $pageArguments = $request->getAttribute('routing');
60  $language = $request->getAttribute('language');
61  $flags = 0;
62  if ($configuration['userFunc.']['prettyPrint'] ?? true) {
63  $flags += JSON_PRETTY_PRINT;
64  }
65  return json_encode([
66  'pageId' => $pageArguments->getPageId(),
67  'pageType' => $pageArguments->getPageType(),
68  'languageId' => $language->getLanguageId(),
69  'staticArguments' => $pageArguments->getStaticArguments(),
70  'routeArguments' => $pageArguments->getRouteArguments(),
71  'dynamicArguments' => $pageArguments->getDynamicArguments(),
72  'queryArguments' => $pageArguments->getQueryArguments(),
73  'requestQueryParams' => $request->getQueryParams(),
74  '_GET' => $_GET,
75  ], $flags);
76  }
77 }
‪TYPO3\CMS\Core\Routing\PageArguments
Definition: PageArguments.php:25
‪TYPO3\CMS\Core\Site\Entity\SiteLanguage
Definition: SiteLanguage.php:25
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
Definition: ContentObjectRenderer.php:91
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Fixtures
Definition: LinkHandlingController.php:3