Validator factory
| package | CONTENIDO Validator |
|---|
getInstance(string $validator, array $options) : \cValidatorAbstract
Sets also validators default options.
Each validator can be configured thru CONTENIDO $cfg configuration variable. Example for email validator:
$cfg['validator']['email'] = array(
// List of top level domains to disallow
'disallow_tld' => array('.test', '.example', '.invalid', '.localhost'),
// List of hosts to disallow
'disallow_host' => array('example.com', 'example.org', 'example.net'),
// Flag to check DNS records for MX type
'mx_check' => false,
);
stringValidator to get
arrayOptions to use for the validator. Any passed option overwrites the related option in global validator configuration.
\cInvalidArgumentException |
If type of validator is unknown or not available |
|---|