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()
        );
    }