/**
* Redirects the request to another action and/or controller.
*
* @param string $actionName Name of the action to forward to
* @param string $controllerName Unqualified object name of the controller to forward to. If not specified, the current controller is used.
* @param string $extensionName Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
* @param array $arguments Arguments to pass to the target action
* @param integer $pageUid Target page uid. If NULL, the current page uid is used
* @param integer $delay (optional) The delay in seconds. Default is no delay.
* @param integer $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other"
*/
protected function redirect(
$actionName,
$controllerName = NULL,
$extensionName = NULL,
array $arguments = NULL,
$pageUid = NULL,
$delay = 0,
$statusCode = 303
)
您必须在重定向方法中传递控制器名称和操作名称才能调用另一个控制器的操作。
请查阅以上帮助您的方法。
或者如果你在模板本身做的事情比可能你必须调用viewhelper。
此代码去哪里,它从哪里调用? – nHaskins
这不是我想要的,但是对于@nHaskins,它可以在任何控制器内部调用,该控制器通过$ this-> redirect('action','')继承'\ TYPO3 \ CMS \ Extbase \ Mvc \ Controller \ ActionController'。 Controller');'但请参阅_redirect_和_forward_ [此处]的文档(https://api.typo3.org/typo3cms/current/html/class_t_y_p_o3_1_1_c_m_s_1_1_extbase_1_1_mvc_1_1_controller_1_1_abstract_controller.html#ac9e12bf23f76776a8b233713773d9de2) – Xervia