PHP Class Constraint_remote, silverstripe-zenvalidator

See readme for example
Inheritance: extends ZenValidatorConstraint
Show file Open project: sheadawson/silverstripe-zenvalidator

Protected Properties

Property Type Description
$method string
$options array
$params array
$url string
$validator string

Public Methods

Method Description
__construct ( string $url, array $params = [], string $options = true, boolean | string $validator = null )
applyParsley ( )
getDefaultMessage ( )
removeParsley ( )
validate ( $value )

Method Details

__construct() public method

public __construct ( string $url, array $params = [], string $options = true, boolean | string $validator = null )
$url string - the url to call via ajax
$params array - request vars
$options string - array of options like { "type": "POST", "dataType": "jsonp", "data": { "token": "value" } }
$validator boolean | string - custom validator or "reverse" By default, all 2xx ajax returs are considered valid, all others failure. You can show frontend server-side specific error messages by returning a 404 error with the error message in the body of the response

applyParsley() public method

public applyParsley ( )

getDefaultMessage() public method

public getDefaultMessage ( )

removeParsley() public method

public removeParsley ( )

validate() public method

public validate ( $value )

Property Details

$method protected property

protected string $method
return string

$options protected property

protected array $options
return array

$params protected property

protected array $params
return array

$url protected property

protected string $url
return string

$validator protected property

protected string $validator
return string