-
Notifications
You must be signed in to change notification settings - Fork 0
Request Helper
Persona Clix edited this page May 25, 2018
·
1 revision
The Request Helper is designed to give information related to the current request made.
To start using the helper, you must add a use statement to the top of the file.
use \PersonaClix\Engine\Helpers\Request;
Returns true if the connection is secured with HTTPS or false otherwise.
if( Request::https() ) {
echo "The connection is secure.";
}
Returns a string with the requested Hostname (e.g. www.example.com).
$host = Request::host();
Returns a string with the requested URI (e.g. /something).
$uri = Request::uri();
Takes the name of the GET Request Variable as a string and returns its value as a string if set or an empty string if not.
$name = Request::get('name');
Takes the name of the POST Request Variable as a string and returns its value as a string if set or an empty string if not.
$name = Request::post('name');