‪TYPO3CMS  10.4
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;
24 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Internal\ArrayValueInstruction;
25 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\RequestBootstrap;
26 
31 {
35  public ‪$cObj;
36 
40  public function ‪mainAction(): string
41  {
42  $instruction = RequestBootstrap::getInternalRequest()
43  ->getInstruction(LinkHandlingController::class);
44  if (!$instruction instanceof ArrayValueInstruction) {
45  return '';
46  }
47  return $this->cObj->cObjGet($instruction->getArray());
48  }
49 
55  public function ‪dumpPageArgumentsAction(?string $content, array $configuration = null): string
56  {
58  $request = ‪$GLOBALS['TYPO3_REQUEST'];
60  $pageArguments = $request->getAttribute('routing');
62  $language = $request->getAttribute('language');
63  $flags = 0;
64  if ($configuration['userFunc.']['prettyPrint'] ?? true) {
65  $flags += JSON_PRETTY_PRINT;
66  }
67  return json_encode([
68  'pageId' => $pageArguments->getPageId(),
69  'pageType' => $pageArguments->getPageType(),
70  'languageId' => $language->getLanguageId(),
71  'staticArguments' => $pageArguments->getStaticArguments(),
72  'routeArguments' => $pageArguments->getRouteArguments(),
73  'dynamicArguments' => $pageArguments->getDynamicArguments(),
74  'queryArguments' => $pageArguments->getQueryArguments(),
75  'requestQueryParams' => $request->getQueryParams(),
76  '_GET' => $_GET,
77  ], $flags);
78  }
79 }
‪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:5
‪TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
Definition: ContentObjectRenderer.php:97
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Fixtures
Definition: LinkHandlingController.php:18