The request helper.
Redirects the browser to a page specified by the $url argument.
// Redirect to http://site.com/test-page
Request::redirect('http://site.com/test-page');
// Redirect to http://site.com/test-page and set status 301
Request::redirect('http://site.com/test-page', 301);
// Redirect to http://site.com/test-page set status 302(Found) with delay 1000
Request::redirect('http://site.com/test-page', 302, 1000);
Set one or multiple headers.
Request::setHeaders('Location: http://site.com/');
Get.
$action = Request::get('action');
Post.
$login = Request::post('login');
Returns whether this is an ajax request or not.
if (Request::isAjax()) {
// do something...
}
Terminate request.
Request::shutdown();