TYPO3  7.6
Link/ActionViewHelper.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Fluid\ViewHelpers\Link;
3 
4 /* *
5  * This script is part of the TYPO3 project - inspiring people to share! *
6  * *
7  * TYPO3 is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU General Public License version 2 as published by *
9  * the Free Software Foundation. *
10  * *
11  * This script is distributed in the hope that it will be useful, but *
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
14  * Public License for more details. *
15  * */
30 {
34  protected $tagName = 'a';
35 
41  public function initializeArguments()
42  {
44  $this->registerTagAttribute('name', 'string', 'Specifies the name of an anchor');
45  $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between the current document and the linked document');
46  $this->registerTagAttribute('rev', 'string', 'Specifies the relationship between the linked document and the current document');
47  $this->registerTagAttribute('target', 'string', 'Specifies where to open the linked document');
48  }
49 
70  public function render($action = null, array $arguments = array(), $controller = null, $extensionName = null, $pluginName = null, $pageUid = null, $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $format = '', $linkAccessRestrictedPages = false, array $additionalParams = array(), $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = array(), $addQueryStringMethod = null)
71  {
72  $uriBuilder = $this->controllerContext->getUriBuilder();
73  $uri = $uriBuilder->reset()->setTargetPageUid($pageUid)->setTargetPageType($pageType)->setNoCache($noCache)->setUseCacheHash(!$noCacheHash)->setSection($section)->setFormat($format)->setLinkAccessRestrictedPages($linkAccessRestrictedPages)->setArguments($additionalParams)->setCreateAbsoluteUri($absolute)->setAddQueryString($addQueryString)->setArgumentsToBeExcludedFromQueryString($argumentsToBeExcludedFromQueryString)->setAddQueryStringMethod($addQueryStringMethod)->uriFor($action, $arguments, $controller, $extensionName, $pluginName);
74  $this->tag->addAttribute('href', $uri);
75  $this->tag->setContent($this->renderChildren());
76  $this->tag->forceClosingTag(true);
77  return $this->tag->render();
78  }
79 }