[TYPO3-mvc] Forward to calling action

Simon Weber weber at voxmedien.de
Wed Jun 23 14:53:40 CEST 2010


Hi,
my solution to this problem is to use my own modified ActionViewHelper 
which works similar to the FormViewHelper. Instead of using hidden 
fields in a form it modifies the $arguments array for the 
$uriBuilder->uriFor()-Call.
Don't know if there's a better solution, but this works ;)


Simon





the modified render()-function:
-------------------------------------------------
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()) {

	$request = $this->controllerContext->getRequest();

	$referrer = array();
	$referrer['actionName'] = $request->getControllerActionName();
	$referrer['controllerName'] = $request->getControllerName();
	$referrer['extensionName'] = $request->getControllerExtensionName();
	
	$arguments['__referrer'] = $referrer;
	
	$uriBuilder = $this->controllerContext->getUriBuilder();
	$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)
		->uriFor($action, $arguments, $controller, $extensionName, $pluginName);

	
	$this->tag->addAttribute('href', $uri);
	$this->tag->setContent($this->renderChildren());

	return $this->tag->render();
}


More information about the TYPO3-project-typo3v4mvc mailing list