JOOMLA中国
  • Joomla中国首页
  • 社区
  • 教程
  • 应用市场
  • B计划
Joomla! Framework TM
  • Namespace
  • Class
  • Tree
  • Deprecated

Namespaces

  • Composer
    • Autoload
  • Joomla
    • Application
      • Cli
        • Output
          • Processor
      • Web
    • Data
    • DI
      • Exception
    • Event
    • Filter
    • Input
    • Ldap
    • Registry
      • Format
    • Session
      • Storage
    • String
    • Uri
    • Utilities
  • None
  • PasswordCompat
    • binary
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Yaml
        • Exception
    • Polyfill
      • Util

Classes

  • Cli
  • Cookie
  • Files
  • Input
  • Json

Class Input

Joomla! Input Base Class

This is an abstracted input class used to manage retrieving data from the application environment.

Joomla\Input\Input implements Serializable, Countable

Direct known subclasses

Joomla\Input\Cli, Joomla\Input\Cookie, Joomla\Input\Files, Joomla\Input\Json

Namespace: Joomla\Input
Since: 1.0
Located at vendor/joomla/input/src/Input.php

Methods summary

public
# __construct( array $source = null, array $options = array() )

Constructor.

Constructor.

Parameters

$source
array - $source Optional source data. If omitted, a copy of the server variable '_REQUEST' is used.
$options
array - $options An optional associative array of configuration parameters: filter: An instance of Filter\Input. If omitted, a default filter is initialised.

Since

1.0
public Joomla\Input\Input
# __get( mixed $name )

Magic method to get an input object

Magic method to get an input object

Parameters

$name
mixed - $name Name of the input object to retrieve.

Returns

Joomla\Input\Input - The request input object

Since

1.0
public integer
# count( )

Get the number of variables.

Get the number of variables.

Returns

integer - The number of variables in the input.

Since

1.0

See

Countable::count()

Implementation of

Countable::count()
public mixed
# get( string $name, mixed $default = null, string $filter = 'cmd' )

Gets a value from the input data.

Gets a value from the input data.

Parameters

$name
string - $name Name of the value to get.
$default
mixed - $default Default value to return if variable does not exist.
$filter
string - $filter Filter to apply to the value.

Returns

mixed - The filtered input value.

Since

1.0

See

Joomla\Filter\InputFilter::clean()
public mixed
# getArray( array $vars = array(), mixed $datasource = null )

Gets an array of values from the request.

Gets an array of values from the request.

Parameters

$vars
array - $vars Associative array of keys and filter types to apply. If empty and datasource is null, all the input data will be returned but filtered using the default case in JFilterInput::clean.
$datasource
mixed - $datasource Array to retrieve data from, or null

Returns

mixed - The filtered input data.

Since

1.0
public
# set( string $name, mixed $value )

Sets a value

Sets a value

Parameters

$name
string - $name Name of the value to set.
$value
mixed - $value Value to assign to the input.

Since

1.0
public
# def( string $name, mixed $value )

Define a value. The value will only be set if there's no value for the name or if it is null.

Define a value. The value will only be set if there's no value for the name or if it is null.

Parameters

$name
string - $name Name of the value to define.
$value
mixed - $value Value to assign to the input.

Since

1.0
public boolean
# exists( string $name )

Check if a value name exists.

Check if a value name exists.

Parameters

$name
string - $path Value name

Returns

boolean

Since

1.2.0
public mixed
# __call( string $name, array $arguments )

Magic method to get filtered input data.

Magic method to get filtered input data.

Parameters

$name
string - $name Name of the filter type prefixed with 'get'.
$arguments
array - $arguments [0] The name of the variable [1] The default value.

Returns

mixed - The filtered input value.

Since

1.0
public string
# getMethod( )

Gets the request method.

Gets the request method.

Returns

string - The request method.

Since

1.0
public string
# serialize( )

Method to serialize the input.

Method to serialize the input.

Returns

string - The serialized input.

Since

1.0

Implementation of

Serializable::serialize()
public Joomla\Input\Input
# unserialize( string $input )

Method to unserialize the input.

Method to unserialize the input.

Parameters

$input
string - $input The serialized input.

Returns

Joomla\Input\Input - The input object.

Since

1.0

Implementation of

Serializable::unserialize()
protected
# loadAllInputs( )

Method to load all of the global inputs.

Method to load all of the global inputs.

Since

1.0

Magic methods summary

public integer
# getInt( mixed $name = , mixed $default = null )

Get a signed integer.

Get a signed integer.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

integer
public integer
# getUint( mixed $name = , mixed $default = null )

Get an unsigned integer.

Get an unsigned integer.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

integer
public float
# getFloat( mixed $name = , mixed $default = null )

Get a floating-point number.

Get a floating-point number.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

float
public boolean
# getBool( mixed $name = , mixed $default = null )

Get a boolean value.

Get a boolean value.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

boolean
public string
# getWord( mixed $name = , mixed $default = null )

Get a word.

Get a word.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

string
public string
# getAlnum( mixed $name = , mixed $default = null )

Get an alphanumeric string.

Get an alphanumeric string.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

string
public string
# getCmd( mixed $name = , mixed $default = null )

Get a CMD filtered string.

Get a CMD filtered string.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

string
public string
# getBase64( mixed $name = , mixed $default = null )

Get a base64 encoded string.

Get a base64 encoded string.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

string
public string
# getString( mixed $name = , mixed $default = null )

Get a string.

Get a string.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

string
public string
# getHtml( mixed $name = , mixed $default = null )

Get a HTML string.

Get a HTML string.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

string
public string
# getPath( mixed $name = , mixed $default = null )

Get a file path.

Get a file path.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

string
public string
# getUsername( mixed $name = , mixed $default = null )

Get a username.

Get a username.

Parameters

$name
mixed - $name
$default
mixed - $default

Returns

string

Properties summary

protected array $options
#

Options array for the Input instance.

Options array for the Input instance.

Since

1.0
protected Joomla\Filter\InputFilter $filter
#

Filter object to use.

Filter object to use.

Since

1.0
protected array $data
#

Input data.

Input data.

Since

1.0
protected Joomla\Input\Input[] $inputs
#

Input objects

Input objects

Since

1.0
protected static boolean $loaded
#

Is all GLOBAL added

Is all GLOBAL added

Since

1.1.4

Magic properties

public read-only Joomla\Input\Input $get
#
public read-only Joomla\Input\Input $post
#
public read-only Joomla\Input\Input $request
#
public read-only Joomla\Input\Input $server
#
public read-only Joomla\Input\Files $files
#
public read-only Joomla\Input\Cookie $cookie
#
Joomla! Framework TM API documentation generated by ApiGen 2.8.0
Joomla!® and Joomla! Framework™ are trademarks of Open Source Matters, Inc. in the United States and other countries.