TYPO3 CMS  TYPO3_7-6
PageViewHelper.php
Go to the documentation of this file.
1 <?php
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  * */
16 
19 
50 {
65  public function render($pageUid = null, array $additionalParams = [], $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $linkAccessRestrictedPages = false, $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = [], $addQueryStringMethod = null)
66  {
67  return static::renderStatic(
68  [
69  'pageUid' => $pageUid,
70  'additionalParams' => $additionalParams,
71  'pageType' => $pageType,
72  'noCache' => $noCache,
73  'noCacheHash' => $noCacheHash,
74  'section' => $section,
75  'linkAccessRestrictedPages' => $linkAccessRestrictedPages,
76  'absolute' => $absolute,
77  'addQueryString' => $addQueryString,
78  'argumentsToBeExcludedFromQueryString' => $argumentsToBeExcludedFromQueryString,
79  'addQueryStringMethod' => $addQueryStringMethod
80  ],
82  $this->renderingContext
83  );
84  }
85 
93  {
94  $pageUid = $arguments['pageUid'];
95  $additionalParams = $arguments['additionalParams'];
96  $pageType = $arguments['pageType'];
97  $noCache = $arguments['noCache'];
98  $noCacheHash = $arguments['noCacheHash'];
99  $section = $arguments['section'];
100  $linkAccessRestrictedPages = $arguments['linkAccessRestrictedPages'];
101  $absolute = $arguments['absolute'];
102  $addQueryString = $arguments['addQueryString'];
103  $argumentsToBeExcludedFromQueryString = $arguments['argumentsToBeExcludedFromQueryString'];
104  $addQueryStringMethod = $arguments['addQueryStringMethod'];
105 
106  $uriBuilder = $renderingContext->getControllerContext()->getUriBuilder();
107  $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();
108  return $uri;
109  }
110 }
static renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
render($pageUid=null, array $additionalParams=[], $pageType=0, $noCache=false, $noCacheHash=false, $section='', $linkAccessRestrictedPages=false, $absolute=false, $addQueryString=false, array $argumentsToBeExcludedFromQueryString=[], $addQueryStringMethod=null)