* ``` * * @see https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-be-uri */ final class UriViewHelper extends AbstractViewHelper { public function __construct( private readonly UriBuilder $uriBuilder ) {} public function initializeArguments(): void { parent::initializeArguments(); $this->registerArgument('route', 'string', 'The name of the route', true); $this->registerArgument('parameters', 'array', 'An array of parameters', false, []); $this->registerArgument( 'referenceType', 'string', 'The type of reference to be generated (one of the constants)', false, UriBuilder::ABSOLUTE_PATH ); } public function render(): string { $route = $this->arguments['route']; $parameters = $this->arguments['parameters']; $referenceType = $this->arguments['referenceType']; $uri = $this->uriBuilder->buildUriFromRoute($route, $parameters, $referenceType); return (string)$uri; } }