[TYPO3-mvc] redirect in Tx_Extbase_MVC_Controller_AbstractController should respect the page typeNum
Marco Huber
marco.huber at marit.ag
Wed Feb 9 16:33:10 CET 2011
Am 09.02.2011 16:08, schrieb Thomas "Thasmo" Deinhamer:
>
> Hello MArco!
>
> Isn't the $pageType missing in the else part then, no?
>
> Regards,
> Thomas
You're right. Or perhaps something like this would be good:
if($pageType){
$uri = $this->uriBuilder
->reset()
->setTargetPageUid($pageUid)
->setTargetPageType($pageType)
->uriFor($actionName, $arguments, $controllerName, $extensionName);
} elseif($pageType === NULL && $GLOBALS['TSFE']->type > 0){
$uri = $this->uriBuilder
->reset()
->setTargetPageUid($pageUid)
->setTargetPageType($GLOBALS['TSFE']->type)
->uriFor($actionName, $arguments, $controllerName, $extensionName);
} else {
$uri = $this->uriBuilder
->reset()
->setTargetPageUid($pageUid)
->uriFor($actionName, $arguments, $controllerName, $extensionName);
}
So the page type is only added when it's really needed.
Regards
Marco
More information about the TYPO3-project-typo3v4mvc
mailing list