TYPO3:后端模块呈现另一个控制器

时间:2017-06-05 07:25:59

标签: typo3 extbase typo3-extensions

在ExtensionBuilder的帮助下,我为TYPO3(7.6.15)创建了一个简单的后端模块。 UserControllerMediaControllercreateActionshowActionlistActionPanelController只有showAction,它是模块的主视图,应该如下所示:

Display of the PanelController.showAction

现在,我想从listActions模板中的其他控制器渲染PanelController.showAction,我想在视图模板(MyExt/Resources/Private/Templates/Panel/Show.html)中执行此操作,如果可能的话。

我提前感谢所有人的帮助,祝大家度过愉快的一天!

2 个答案:

答案 0 :(得分:0)

/**
 * 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。

答案 1 :(得分:0)

好吧,多年来,我什至没有意识到这个问题仍然悬而未决。我只是加载了两个外部控制器以获取所需的所有数据。然后,我将数据传递到视图本身内的正确视图模板,这些模板是原始列表操作的视图。

相关问题