PHP Class ZenValidatorConstraint, silverstripe-zenvalidator

Author: ([email protected])
Inheritance: extends Object
Afficher le fichier Open project: sheadawson/silverstripe-zenvalidator Class Usage Examples

Protected Properties

Свойство Type Description
$customMessage string
$field FormField
$parsleyApplied boolean

Méthodes publiques

Méthode Description
applyParsley ( ) : void Sets the html attributes required for frontend validation Subclasses should call parent::applyParsley
getConstraintName ( ) : string Gets the name of this constraint from it's classname which should correspond to the string that parsley uses to identify a constraint type
getDefaultMessage ( ) : string Return the default message for this constraint
getField ( ) : FormField
getMessage ( ) : string Get's the message that was set on the constrctor or falls back to default
loadExtra ( string $name ) Load extra validator
removeParsley ( ) : void Removes the html attributes required for frontend validation Subclasses should call parent::removeParsley
setField ( FormField $field ) : this Set the field this constraint is applied to
setMessage ( string $message ) : this Set a custom message for this constraint
validate ( $value ) : boolean Performs php validation on the value

Method Details

applyParsley() public méthode

Sets the html attributes required for frontend validation Subclasses should call parent::applyParsley
public applyParsley ( ) : void
Résultat void

getConstraintName() public méthode

Gets the name of this constraint from it's classname which should correspond to the string that parsley uses to identify a constraint type
public getConstraintName ( ) : string
Résultat string

getDefaultMessage() abstract public méthode

Return the default message for this constraint
abstract public getDefaultMessage ( ) : string
Résultat string

getField() public méthode

public getField ( ) : FormField
Résultat FormField

getMessage() public méthode

Get's the message that was set on the constrctor or falls back to default
public getMessage ( ) : string
Résultat string

loadExtra() public méthode

Load extra validator
public loadExtra ( string $name )
$name string

removeParsley() public méthode

Removes the html attributes required for frontend validation Subclasses should call parent::removeParsley
public removeParsley ( ) : void
Résultat void

setField() public méthode

Set the field this constraint is applied to
public setField ( FormField $field ) : this
$field FormField
Résultat this

setMessage() public méthode

Set a custom message for this constraint
public setMessage ( string $message ) : this
$message string
Résultat this

validate() abstract public méthode

Performs php validation on the value
abstract public validate ( $value ) : boolean
$value
Résultat boolean

Property Details

$customMessage protected_oe property

protected string $customMessage
Résultat string

$field protected_oe property

protected FormField $field
Résultat FormField

$parsleyApplied protected_oe property

protected bool $parsleyApplied
Résultat boolean