‪TYPO3CMS  10.4
UrlLinkHandler.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Psr\Http\Message\ServerRequestInterface;
21 
27 {
33  protected ‪$linkParts = [];
34 
40  protected ‪$updateSupported = false;
41 
45  public function ‪__construct()
46  {
47  parent::__construct();
48  // remove unsupported link attribute
49  unset($this->linkAttributes[array_search('params', $this->linkAttributes, true)]);
50  }
51 
61  public function ‪canHandleLink(array ‪$linkParts)
62  {
63  if (!isset(‪$linkParts['url']['url'])) {
64  return false;
65  }
66  ‪$linkParts['url'] = ‪$linkParts['url']['url'];
67  $this->linkParts = ‪$linkParts;
68 
69  return true;
70  }
71 
77  public function ‪formatCurrentUrl()
78  {
79  return $this->linkParts['url'];
80  }
81 
89  public function ‪render(ServerRequestInterface $request)
90  {
91  GeneralUtility::makeInstance(PageRenderer::class)->loadRequireJsModule('TYPO3/CMS/Recordlist/UrlLinkHandler');
92 
93  $this->view->assign('url', !empty($this->linkParts) ? $this->linkParts['url'] : '');
94  return $this->view->render('Url');
95  }
96 
100  public function ‪getBodyTagAttributes()
101  {
102  return [];
103  }
104 }
‪TYPO3\CMS\Core\Page\PageRenderer
Definition: PageRenderer.php:42
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46