Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在typo3 V10中重定向到extbase控制器中的404页_Typo3_Typo3 10.x - Fatal编程技术网

如何在typo3 V10中重定向到extbase控制器中的404页

如何在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. () 在控制器中

在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.
()

在控制器中,您必须使用
$GLOBALS['TYPO3\u REQUEST']
而不是
$this->REQUEST

提示:使用
ImmediateResponseException
将不会调用进一步的操作

示例方法:

   $response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
            $GLOBALS['TYPO3_REQUEST'],
            'your 404 message'
        );
        throw new ImmediateResponseException($response, 1591428020);