‪TYPO3CMS  10.4
UriViewHelper.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 
20 
40 {
41 
47  public function ‪initializeArguments()
48  {
49  parent::initializeArguments();
50  $this->registerArgument('route', 'string', 'The name of the route', true);
51  $this->registerArgument('parameters', 'array', 'An array of parameters', false, []);
52  $this->registerArgument(
53  'referenceType',
54  'string',
55  'The type of reference to be generated (one of the constants)',
56  false,
58  );
59  }
60 
64  public function ‪render()
65  {
67  $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
68  $route = $this->arguments['route'];
69  $parameters = $this->arguments['parameters'];
70  $referenceType = $this->arguments['referenceType'];
71  $uri = $uriBuilder->buildUriFromRoute($route, $parameters, $referenceType);
72 
73  return (string)$uri;
74  }
75 }
‪TYPO3\CMS\Fluid\ViewHelpers\Be\UriViewHelper\render
‪string render()
Definition: UriViewHelper.php:64
‪TYPO3\CMS\Fluid\ViewHelpers\Be\UriViewHelper
Definition: UriViewHelper.php:40
‪TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper
Definition: AbstractBackendViewHelper.php:28
‪TYPO3\CMS\Fluid\ViewHelpers\Be
Definition: AbstractBackendViewHelper.php:16
‪TYPO3\CMS\Backend\Routing\UriBuilder\ABSOLUTE_PATH
‪const ABSOLUTE_PATH
Definition: UriBuilder.php:47
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:38
‪TYPO3\CMS\Fluid\ViewHelpers\Be\UriViewHelper\initializeArguments
‪initializeArguments()
Definition: UriViewHelper.php:47
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46