PHP 클래스 Input, newscoop

파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

공개 메소드들

메소드 설명
CleanMagicQuotes ( array $p_array ) : array Please see: {@link http://ca.php.net/manual/en/function.get-magic-quotes-gpc.php this PHP.net page specifically the user note by php at kaiundina dot de}, for why this is so complicated.
Get ( string $p_varName, string $p_type = 'string', mixed $p_defaultValue = null, boolean $p_errorsOk = false ) : mixed Get an input value from the $_REQUEST array and check its type.
GetErrorString ( ) : string Return a default error string.
GetMethod ( ) : string Returns the method used to read the input data: GET, POST etc.
GetVar ( $p_varName, $p_type = 'string', $p_defaultValue = null, $p_errorsOk = false ) Get an input value from the $_REQUEST array and check its type.
IsValid ( ) : boolean Return FALSE if any calls to Input::Get() resulted in an error.

메소드 상세

CleanMagicQuotes() 공개 정적인 메소드

Please see: {@link http://ca.php.net/manual/en/function.get-magic-quotes-gpc.php this PHP.net page specifically the user note by php at kaiundina dot de}, for why this is so complicated.
public static CleanMagicQuotes ( array $p_array ) : array
$p_array array
리턴 array

Get() 공개 정적인 메소드

The default value is returned if the value is not defined in the $_REQUEST array, or if the value does not match the required type. The type 'checkbox' is special - you cannot specify a default value for this. The return value will be TRUE or FALSE, but you can change this by specifying 'numeric' as the 3rd parameter in which case it will return '1' or '0'. Use Input::IsValid() to check if any errors were generated.
public static Get ( string $p_varName, string $p_type = 'string', mixed $p_defaultValue = null, boolean $p_errorsOk = false ) : mixed
$p_varName string The index into the $_REQUEST array.
$p_type string The type of data expected; can be: "int" "string" "array" "checkbox" "boolean" Default is 'string'.
$p_defaultValue mixed The default value to return if the value is not defined in the $_REQUEST array, or if the value does not match the required type.
$p_errorsOk boolean Set to true to ignore any errors for this variable (i.e. Input::IsValid() will still return true even if there are errors for this varaible).
리턴 mixed

GetErrorString() 공개 정적인 메소드

Return a default error string.
public static GetErrorString ( ) : string
리턴 string

GetMethod() 공개 정적인 메소드

Returns the method used to read the input data: GET, POST etc.
public static GetMethod ( ) : string
리턴 string

GetVar() 공개 정적인 메소드

This is a wrapper for Input::Get().
public static GetVar ( $p_varName, $p_type = 'string', $p_defaultValue = null, $p_errorsOk = false )

IsValid() 공개 정적인 메소드

Return FALSE if any calls to Input::Get() resulted in an error.
public static IsValid ( ) : boolean
리턴 boolean