Example #1
0
 /**
  * 
  * Redireciona a requisição e encerra a execução do script
  * 
  * @param Route|string|null $params 
  * 
  * @return void
  * 
  */
 public function redirect($params = NULL)
 {
     if (empty($params)) {
         return $this->header('Location: ' . Router::href());
     }
     if (is_string($params)) {
         return $this->header('Location: ' . $params);
     }
     if (is_array($params)) {
         $controller = empty($params['controller']) ? 'main' : $params['controller'];
         $action = empty($params['action']) ? 'index' : $params['action'];
         return $this->header('Location: ' . Router::href("{$controller}/{$action}"));
     } else {
         return $this->header('Location: ' . Router::href());
     }
     exit;
 }
Example #2
0
 public static function href($uri = '')
 {
     return Router::href($uri);
 }