如何在typo3 V10中重定向到extbase控制器中的404页
在TYPO3 v10中,您不能再使用$TSFE->pageNotFoundAndExit()。但是控制器操作中的如何在typo3 V10中重定向到extbase控制器中的404页,typo3,typo3-10.x,Typo3,Typo3 10.x,在TYPO3 v10中,您不能再使用$TSFE->pageNotFoundAndExit()。但是控制器操作中的$this->request在使用ErrorController PageNotFound方法时会出现异常 $TSFE->pageNotFoundAndExit() will be removed in TYPO3 v10.0. Use TYPO3's ErrorController with Request/Response objects instead. () 在控制器中
$this->request
在使用ErrorController PageNotFound方法时会出现异常
$TSFE->pageNotFoundAndExit() will be removed in TYPO3 v10.0. Use TYPO3's ErrorController with Request/Response objects instead.
()
在控制器中,您必须使用$GLOBALS['TYPO3\u REQUEST']
而不是$this->REQUEST
提示:使用ImmediateResponseException
将不会调用进一步的操作
示例方法:
$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
$GLOBALS['TYPO3_REQUEST'],
'your 404 message'
);
throw new ImmediateResponseException($response, 1591428020);