PHP 클래스 Prado\Web\UI\WebControls\TRegularExpressionValidator

TRegularExpressionValidator validates whether the value of an associated input component matches the pattern specified by a regular expression. You can specify the regular expression by setting the {@link setRegularExpression RegularExpression} property. Some commonly used regular expressions include:
French Phone Number: (0( \d|\d ))?\d\d \d\d(\d \d| \d\d )\d\d
French Postal Code: \d{5}
German Phone Number: ((\(0\d\d\) |(\(0\d{3}\) )?\d )?\d\d \d\d \d\d|\(0\d{4}\) \d \d\d-\d\d?)
German Postal Code: (D-)?\d{5}
Email Address: \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
Japanese Phone Number: (0\d{1,4}-|\(0\d{1,4}\) ?)?\d{1,4}-\d{4}
Japanese Postal Code: \d{3}(-(\d{4}|\d{2}))?
P.R.C. Phone Number: (\(\d{3}\)|\d{3}-)?\d{8}
P.R.C. Postal Code: \d{6}
P.R.C. Social Security Number: \d{18}|\d{15}
U.S. Phone Number: ((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}
U.S. ZIP Code: \d{5}(-\d{4})?
U.S. Social Security Number: \d{3}-\d{2}-\d{4}
Note, the validation succeeds if the associated input control contains empty input. Use a {@link TRequiredFieldValidator} to ensure the input is not empty.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends TBaseValidator
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
evaluateIsValid ( ) : boolean This method overrides the parent's implementation.
getClientSidePatternModifiers ( ) : string
getPatternModifiers ( ) : string
getRegularExpression ( ) : string
setClientSidePatternModifiers ( $value )
setPatternModifiers ( $value )
setRegularExpression ( $value )

보호된 메소드들

메소드 설명
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing validation for this control.
getClientScriptOptions ( ) : array Returns an array of javascript validator options.

메소드 상세

evaluateIsValid() 공개 메소드

The validation succeeds if the input data matches the regular expression. The validation always succeeds if ControlToValidate is not specified or the regular expression is empty, or the input data is empty.
public evaluateIsValid ( ) : boolean
리턴 boolean whether the validation succeeds

getClientClassName() 보호된 메소드

This method overrides the parent implementation.
protected getClientClassName ( ) : string
리턴 string the javascript class name

getClientScriptOptions() 보호된 메소드

Returns an array of javascript validator options.
protected getClientScriptOptions ( ) : array
리턴 array javascript validator options.

getClientSidePatternModifiers() 공개 메소드

public getClientSidePatternModifiers ( ) : string
리턴 string clientside pattern modifiers, no modifiers by default.

getPatternModifiers() 공개 메소드

public getPatternModifiers ( ) : string
리턴 string pattern modifiers, no modifiers by default.

getRegularExpression() 공개 메소드

public getRegularExpression ( ) : string
리턴 string the regular expression that determines the pattern used to validate a field.

setClientSidePatternModifiers() 공개 메소드

public setClientSidePatternModifiers ( $value )

setPatternModifiers() 공개 메소드

public setPatternModifiers ( $value )

setRegularExpression() 공개 메소드

public setRegularExpression ( $value )