You are here

public function Validator::__construct in Form API Validation 8.2

Create object and parse validator data.

Parameters

array|string $raw_validator: Raw user defined validator.

string $value: Form element value.

File

src/Validator.php, line 59

Class

Validator
Validator Class to parse Form Element validators content.

Namespace

Drupal\fapi_validation

Code

public function __construct($raw_validator, $value) {
  $this->rawValidator = $raw_validator;
  $this->value = $value;
  $this
    ->parse();
}