/** * Redirect to ressource * @param String $locale [optional default null] : Set a different locale for page (if site is locale-enabled and uses url to transmit locale) * @param bool $secure [optional default null] : if true force https, if false force http, if null keep current potocole * @warning No output must be made prior to redirection for headers to be valid. */ public function redirect($locale = null, $secure = null) { header("Location: http" . ($secure === true || $secure === null && BF::is_secure() ? 's' : '') . "://" . $_SERVER['HTTP_HOST'] . $this->url($locale)); exit; }