‪TYPO3CMS  9.5
UriViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
19 
39 {
40 
46  public function ‪initializeArguments()
47  {
48  parent::initializeArguments();
49  $this->registerArgument('route', 'string', 'The name of the route', true);
50  $this->registerArgument('parameters', 'array', 'An array of parameters', false, []);
51  $this->registerArgument(
52  'referenceType',
53  'string',
54  'The type of reference to be generated (one of the constants)',
55  false,
57  );
58  }
59 
63  public function ‪render()
64  {
66  $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
67  $route = $this->arguments['route'];
68  $parameters = $this->arguments['parameters'];
69  $referenceType = $this->arguments['referenceType'];
70  $uri = $uriBuilder->buildUriFromRoute($route, $parameters, $referenceType);
71 
72  return (string)$uri;
73  }
74 }
‪TYPO3\CMS\Fluid\ViewHelpers\Be\UriViewHelper\render
‪string render()
Definition: UriViewHelper.php:63
‪TYPO3\CMS\Fluid\ViewHelpers\Be\UriViewHelper
Definition: UriViewHelper.php:39
‪TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper
Definition: AbstractBackendViewHelper.php:27
‪TYPO3\CMS\Fluid\ViewHelpers\Be
Definition: AbstractBackendViewHelper.php:2
‪TYPO3\CMS\Backend\Routing\UriBuilder\ABSOLUTE_PATH
‪const ABSOLUTE_PATH
Definition: UriBuilder.php:44
‪TYPO3\CMS\Backend\Routing\UriBuilder
Definition: UriBuilder.php:35
‪TYPO3\CMS\Fluid\ViewHelpers\Be\UriViewHelper\initializeArguments
‪initializeArguments()
Definition: UriViewHelper.php:46
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45