Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

Class Request

This class define methods to get HTTP request information

Hawk\Singleton
Extended by Hawk\Request
Final
Namespace: Hawk
Package: Core
Located at Request.php

Methods summary

protected
# __construct( )

Constrcutor, initialize the instance with the HTTP request data

Constrcutor, initialize the instance with the HTTP request data

Overrides

Hawk\Singleton::__construct
public string
# getMethod( )

Get the HTTP request method

Get the HTTP request method

Returns

string
the HTTP request method
public string
# getUri( )

Get the HTTP request URI

Get the HTTP request URI

Returns

string
The HTTP request URI
public true
# isAjax( )

Check if the request is an AJAX request

Check if the request is an AJAX request

Returns

true
if the request is an AJAX request else false
public string
# clientIp( )

Get the client IP address.

Get the client IP address.

Returns

string
The IPV4 address of the client that performed the HTTP request
public string|array
# getBody( string $name = "" )

This function returns the value of the variable $name in the request body, or all the body if $name is not provided

This function returns the value of the variable $name in the request body, or all the body if $name is not provided

Parameters

$name
The variable name

Returns

string|array
The parameter value or all the body
public string|array
# getFiles( string $name = '' )

Get the request uploaded files for the given name, or all files if $name is not provided

Get the request uploaded files for the given name, or all files if $name is not provided

Parameters

$name
The key in $_FILES to get

Returns

string|array
The file or all files
public string|array
# getParams( string $name = "" )

This function returns the value of the parameter $name, or all the parameters if $name is not provided

This function returns the value of the parameter $name, or all the parameters if $name is not provided

Parameters

$name
The parameter name

Returns

string|array
The parameter value or all the parameters
public string|array
# getHeaders( string $name = "" )

This function returns the header value for the key $name, of all the headers if $name is not provided

This function returns the header value for the key $name, of all the headers if $name is not provided

Parameters

$name
The header key

Returns

string|array
The header value or all the headers
public string|array
# getCookies( string $name = "" )

This function returns the value of the cookie named $name, or all cookies if $name is not provided

This function returns the value of the cookie named $name, or all cookies if $name is not provided

Parameters

$name
The cookie name

Returns

string|array
The cookie value or all the cookies

Methods inherited from Hawk\Singleton

getInstance()

Properties summary

public $clientIp

The clientIp, registered as static variable, to avoid to calculate it each time

The clientIp, registered as static variable, to avoid to calculate it each time

#
public string $uri

The request URI

The request URI

#
public string $method

The request method (GET, POST, PATCH, DELETE, PUT)

The request method (GET, POST, PATCH, DELETE, PUT)

#
public array $params

The request parameters

The request parameters

#
public array $headers

The request headers

The request headers

#
public mixed $body

The request body

The request body

#
public array $files

The uploaded files

The uploaded files

# array()
public array $cookies

The request sent cookies

The request sent cookies

# array()
protected static Hawk\Request $instance

The request instance

The request instance

#
Hawk - PHP documentation API documentation generated by ApiGen