PHP 인터페이스 Fuel\Validation\RuleInterface

부터: 2.0
저자: Fuel Development Team
파일 보기 프로젝트 열기: fuelphp/validation 0 사용 예제들

공개 메소드들

메소드 설명
canAlwaysRun ( ) : boolean TODO: Docblock
getMessage ( ) : string Gets the failure message for this rule
getMessageParameters ( ) : string[] Returns a list of tokens that will be injected into the message before it is returned from getMessage
getParameter ( ) : mixed Returns the value of the set parameter.
setMessage ( string $message ) Sets the failure message for this rule
setParameter ( mixed $params ) Sets the parameter for this validation rule.
validate ( mixed $value, string $field = null, array $allFields = null ) : boolean | Fuel\Validation\ResultInterface Performs validation on the given value.

메소드 상세

canAlwaysRun() 공개 메소드

TODO: Docblock
public canAlwaysRun ( ) : boolean
리턴 boolean

getMessage() 공개 메소드

Gets the failure message for this rule
부터: 2.0
public getMessage ( ) : string
리턴 string

getMessageParameters() 공개 메소드

Returns a list of tokens that will be injected into the message before it is returned from getMessage
부터: 2.0
public getMessageParameters ( ) : string[]
리턴 string[]

getParameter() 공개 메소드

See each Rule's documentation for what the parameter does.
부터: 2.0
public getParameter ( ) : mixed
리턴 mixed

setMessage() 공개 메소드

Sets the failure message for this rule
부터: 2.0
public setMessage ( string $message )
$message string

setParameter() 공개 메소드

See each Rule's documentation for what this should be.
부터: 2.0
public setParameter ( mixed $params )
$params mixed

validate() 공개 메소드

$field and $allFields are optional values to allow the validation rule to have some idea of context. This allows for rules such as "required" and "match field", validation rules that act on all the data rather than a single field. If a validation rule requires $field or $allFields but is not passed a value the rule should return false rather than throwing an exception.
부터: 2.0
public validate ( mixed $value, string $field = null, array $allFields = null ) : boolean | Fuel\Validation\ResultInterface
$value mixed Value to validate
$field string Name of the field that is being validated
$allFields array Values of all the other fields being validated
리턴 boolean | Fuel\Validation\ResultInterface