/**
* To redirect the page to a new page
* @param string $path
* @param int $httpCode
*/
public function redirect($url = "", $httpCode = 302)
{
if (!$url) {
$url = $this->getControllerUrl();
}
if (preg_match("/^http/", $url)) {
// http://xyz
$url = $url;
} else {
if (preg_match("/^\\//", $url)) {
// we'll add the ? if possible
$url = $this->getBaseUrl() . $url;
} else {
// go to the current module
$url = $this->getModuleUrl() . "/{$url}";
}
}
$this->abort();
return Http\Response::redirect($url, $httpCode);
}