17 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
47 parent::initializeArguments();
48 $this->registerUniversalTagAttributes();
49 $this->registerTagAttribute(
'name',
'string',
'Specifies the name of an anchor');
50 $this->registerTagAttribute(
'rel',
'string',
'Specifies the relationship between the current document and the linked document');
51 $this->registerTagAttribute(
'rev',
'string',
'Specifies the relationship between the linked document and the current document');
52 $this->registerTagAttribute(
'target',
'string',
'Specifies where to open the linked document');
53 $this->registerArgument(
'useCacheHash',
'bool',
'True whether the cache hash should be appended to the URL',
false,
false);
54 $this->registerArgument(
'addQueryStringMethod',
'string',
'Method to be used for query string');
55 $this->registerArgument(
'action',
'string',
'Target action');
56 $this->registerArgument(
'arguments',
'array',
'Arguments',
false, []);
57 $this->registerArgument(
'section',
'string',
'The anchor to be added to the URI',
false,
'');
58 $this->registerArgument(
'format',
'string',
'The requested format, e.g. ".html',
false,
'');
59 $this->registerArgument(
'ajax',
'bool',
'TRUE if the URI should be to an AJAX widget, FALSE otherwise.',
false,
false);
69 $ajax = $this->arguments[
'ajax'];
76 $this->tag->addAttribute(
'href', $uri);
77 $this->tag->setContent($this->renderChildren());
78 return $this->tag->render();
88 $action = $this->arguments[
'action'];
89 $arguments = $this->arguments[
'arguments'];
90 if ($action ===
null) {
91 $action = $this->renderingContext->getControllerContext()->getRequest()->getControllerActionName();
95 $arguments[
'type'] = 7076;
96 $arguments[
'fluid-widget-id'] = $this->renderingContext->getControllerContext()->getRequest()->getWidgetContext()->getAjaxWidgetIdentifier();
97 $arguments[
'action'] = $action;
98 return '?' . http_build_query($arguments,
null,
'&');
108 $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
109 $argumentPrefix = $this->renderingContext->getControllerContext()->getRequest()->getArgumentPrefix();
110 $arguments = $this->hasArgument(
'arguments') ? $this->arguments[
'arguments'] : [];
111 if ($this->hasArgument(
'action')) {
112 $arguments[
'action'] = $this->arguments[
'action'];
114 if ($this->hasArgument(
'format') && $this->arguments[
'format'] !==
'') {
115 $arguments[
'format'] = $this->arguments[
'format'];
117 return $uriBuilder->reset()
118 ->setArguments([$argumentPrefix => $arguments])
119 ->setSection($this->arguments[
'section'])
120 ->setUseCacheHash($this->arguments[
'useCacheHash'])
121 ->setAddQueryString(
true)
122 ->setAddQueryStringMethod($this->arguments[
'addQueryStringMethod'])
123 ->setArgumentsToBeExcludedFromQueryString([$argumentPrefix,
'cHash'])
124 ->setFormat($this->arguments[
'format'])