Example #1
0
 /**
  *This method redirect to the specified page
  *
  *@param string $path The path to redirect to 
  *@param mixed $data The data with which to do redirect
  */
 public static function to($path, $data = null)
 {
     //compose full url
     $path = Url::base($path);
     //redirect to path
     header('Location: ' . $path);
     //stop any further html output
     exit;
 }
Example #2
0
 /**
  *This method redirect to the specified page
  *
  *@param string $path The path to redirect to 
  *@param mixed $data The data with which to do redirect
  */
 public static function to($path, array $data = null)
 {
     //compose query string if data was set
     $data !== null ? self::with($data) : '';
     //compose full url
     $path = self::$query_string === null ? Url::link($path) : Url::link($path) . '?' . self::$query_string;
     //redirect to path
     header('Location: ' . $path);
     //stop any further html output
     exit;
 }