17 use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
18 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
19 use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
62 use CompileWithRenderStatic;
69 $this->registerArgument(
'pageUid',
'int',
'target PID');
70 $this->registerArgument(
'additionalParams',
'array',
'query parameters to be attached to the resulting URI',
false, []);
71 $this->registerArgument(
'pageType',
'int',
'type of the target page. See typolink.parameter',
false, 0);
72 $this->registerArgument(
'noCache',
'bool',
'set this to disable caching for the target page. You should not need this.',
false,
false);
73 $this->registerArgument(
'noCacheHash',
'bool',
'set this to suppress the cHash query parameter created by TypoLink. You should not need this.',
false,
false);
74 $this->registerArgument(
'section',
'string',
'the anchor to be added to the URI',
false,
'');
75 $this->registerArgument(
'linkAccessRestrictedPages',
'bool',
'If set, links pointing to access restricted pages will still link to the page even though the page cannot be accessed.',
false,
false);
76 $this->registerArgument(
'absolute',
'bool',
'If set, the URI of the rendered link is absolute',
false,
false);
77 $this->registerArgument(
'addQueryString',
'bool',
'If set, the current query parameters will be kept in the URI',
false,
false);
78 $this->registerArgument(
'argumentsToBeExcludedFromQueryString',
'array',
'arguments to be removed from the URI. Only active if $addQueryString = TRUE',
false, []);
79 $this->registerArgument(
'addQueryStringMethod',
'string',
'Set which parameters will be kept. Only active if $addQueryString = TRUE');
88 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
90 $pageUid = $arguments[
'pageUid'];
91 $additionalParams = $arguments[
'additionalParams'];
92 $pageType = $arguments[
'pageType'];
93 $noCache = $arguments[
'noCache'];
94 $noCacheHash = $arguments[
'noCacheHash'];
95 $section = $arguments[
'section'];
96 $linkAccessRestrictedPages = $arguments[
'linkAccessRestrictedPages'];
97 $absolute = $arguments[
'absolute'];
98 $addQueryString = $arguments[
'addQueryString'];
99 $argumentsToBeExcludedFromQueryString = $arguments[
'argumentsToBeExcludedFromQueryString'];
100 $addQueryStringMethod = $arguments[
'addQueryStringMethod'];
102 $uriBuilder = $renderingContext->getControllerContext()->getUriBuilder();
103 $uri = $uriBuilder->setTargetPageUid($pageUid)->setTargetPageType($pageType)->setNoCache($noCache)->setUseCacheHash(!$noCacheHash)->setSection($section)->setLinkAccessRestrictedPages($linkAccessRestrictedPages)->setArguments($additionalParams)->setCreateAbsoluteUri($absolute)->setAddQueryString($addQueryString)->setArgumentsToBeExcludedFromQueryString($argumentsToBeExcludedFromQueryString)->setAddQueryStringMethod($addQueryStringMethod)->build();