Beispiel #1
0
 /**
  * redirect back or to home page if the previous url not found
  * @param  array $with params sent with the url
  * @param  int $after num of second to wait before redirecting
  * @return void
  */
 public static function redirectBack($with = [], $after = 0)
 {
     if (isset($_SERVER['HTTP_REFERER'])) {
         self::redirectTo($_SERVER['HTTP_REFERER'], $with, $after);
     } else {
         self::redirectTo(Url::app(), $with, $after);
     }
 }
Beispiel #2
0
 /**
  * Returns the complete URL of the current page (not reliable because not all getClient-agents
  * @return (type) (description)
  */
 public static function getPrevUrl()
 {
     return self::SERVER('HTTP_REFERER') ? self::SERVER('HTTP_REFERER') : Url::app();
 }