Zend Framework 2 Redirect

后端 未结 4 2408
鱼传尺愫
鱼传尺愫 2021-02-20 17:26

How can I redirect to another module?

return $this->redirect()->toRoute(null, array(
    \'module\'     => \'othermodule\',
    \'controller\' => \'s         


        
4条回答
  •  说谎
    说谎 (楼主)
    2021-02-20 17:42

    This is the way of redirection in ZF2:

    return $this->redirect()->toRoute('ModuleName',
      array('controller'=>$controllerName,
            'action' => $actionName,
            'params' =>$params));
    

    I hope this helps you.

提交回复
热议问题