public function redirectToRoute()
    {
        if ($this->getRequest()
                 ->isXmlHttpRequest()) {
            return [
                'redirect' => call_user_func_array(
                    [
                        $this->url(),
                        'fromRoute',
                    ],
                    func_get_args()
                ),
            ];
        }

        return call_user_func_array(
            [
                $this->redirect(),
                'toRoute',
            ],
            func_get_args()
        );
    }
public function redirectToRoute()
    {
        if ($this->getRequest()
                 ->isXmlHttpRequest()) {
            return [
                'redirect' => call_user_func_array(
                    [
                        $this->url(),
                        'fromRoute',
                    ],
                    func_get_args()
                ),
            ];
        }

        return call_user_func_array(
            [
                $this->redirect(),
                'toRoute',
            ],
            func_get_args()
        );
    }
public function redirectToRoute ( ) { if ( $ this -> getRequest ( ) -> isXmlHttpRequest ( ) ) { return [ 'redirect' => call_user_func_array ( [ $ this -> url ( ) , 'fromRoute' , ] , func_get_args ( ) ) , ] ; } return call_user_func_array ( [ $ this -> redirect ( ) , 'toRoute' , ] , func_get_args ( ) ) ; }
Redirect to a route, or pass the url to the view for a javascript redirect

@return mixed|\Zend\Http\Response
Redirect to a route or pass the url to the view for a javascript redirect