Skip to content

Commit

Permalink
method redirect in controller
Browse files Browse the repository at this point in the history
  • Loading branch information
foxtech6 committed May 18, 2019
1 parent 8ea75e5 commit 4621eff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Kernel/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ public function render(string $view, array $params = []): self
return $this;
}

/**
* Redirect to location
*
* @param string $url When want redirect
* @param int $statusCode optional Redirect status code
*/
public function redirect(string $url, int $statusCode = null): void
{
header('Location: ' . $url, true, $statusCode);
die();
}

/**
* Set request is ajax
*/
Expand Down

0 comments on commit 4621eff

Please sign in to comment.