/** * @param integer $code * @param string $location */ private function httpRedirection($code, $location) { // Prefix the site URL to $location: if (!in_array(parse_url($location, PHP_URL_SCHEME), array('http', 'https'))) { $url = $this->view->getSiteUrl() . $location; } $this->response->setStatus(302)->addHeader('Location: ' . $url); return $this; }