19 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
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(
'referenceType',
'string',
'The type of reference to be generated (one of the constants)',
false,
UriBuilder::ABSOLUTE_PATH);
52 $this->registerTagAttribute(
'name',
'string',
'Specifies the name of an anchor');
53 $this->registerTagAttribute(
56 'Specifies the relationship between the current document and the linked document'
58 $this->registerTagAttribute(
61 'Specifies the relationship between the linked document and the current document'
63 $this->registerTagAttribute(
'target',
'string',
'Specifies where to open the linked document');
64 $this->registerUniversalTagAttributes();
72 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
73 $route = $this->arguments[
'route'];
74 $parameters = $this->arguments[
'parameters'];
75 $referenceType = $this->arguments[
'referenceType'];
77 $uri = $uriBuilder->buildUriFromRoute($route, $parameters, $referenceType);
79 $this->tag->addAttribute(
'href', $uri);
80 $this->tag->setContent($this->renderChildren());
81 $this->tag->forceClosingTag(
true);
83 return $this->tag->render();