Documentation

Request


The request helper.


redirect(string $url, [integer $status = 302, [integer $delay = null]])


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);

setHeaders(mixed $headers)


Set one or multiple headers.


Request::setHeaders('Location: http://site.com/');

get(string $key)


Get.


$action = Request::get('action');

post(string $key)


Post.


$login = Request::post('login');

isAjax()


Returns whether this is an ajax request or not.


if (Request::isAjax()) {
    // do something...
}

shutdown()


Terminate request.


Request::shutdown();