Input class

The input class allows you to access HTTP parameters, load server variables and user agent details.

package Fuel
category Core
link http://docs.fuelphp.com/classes/input.html

 Methods

Static calls to the current input instance

__callStatic($method, $arguments) 

Parameters

$method

$arguments

Fetch an item from the FILE array

file(string $index, mixed $default) : string | array

Parameters

$index

string

The index key

$default

mixed

The default value

Returns

stringarray

Forge a new instance

forge(\Fuel\Core\Request $new, \Fuel\Core\Input_Instance $input) : \Fuel\Core\Input_Instance

Parameters

$new

\Fuel\Core\$new

Request New request instance this input instance is tied to

$input

\Fuel\Core\$active

Input_Instance Currently active input instance

Returns

Fetch a item from the HTTP request headers

headers(mixed $index, mixed $default) : array

Parameters

$index

mixed

$default

mixed

Returns

array

Return the current input instance

instance() : \Fuel\Core\Input_Instance

Get the public ip address of the user.

ip(string $default) : array | string

Parameters

$default

string

Returns

arraystring

Return's whether this is an AJAX request or not

is_ajax() : bool

Returns

bool

Return's the protocol that the request was made with

protocol() : string

Returns

string

Return's the query string

query_string(string $default) : string

Parameters

$default

string

Returns

string

Get the real ip address of the user.

real_ip(string $default, bool $exclude_reserved) : string

Even if they are using a proxy.

Parameters

$default

string

the default to return on failure

$exclude_reserved

bool

exclude private and reserved IPs

Returns

stringthe real ip address of the user

Return's the referrer

referrer(string $default) : string

Parameters

$default

string

Returns

string

Fetch an item from the SERVER array

server(string $index, mixed $default) : string | array

Parameters

$index

string

The index key

$default

mixed

The default value

Returns

stringarray

Return's the user agent

user_agent($default) : string

Parameters

$default

Returns

string

 Properties

 

global static input instance

$instance