hook_validation_constraint_alter

hook_validation_constraint_alter(array &$definitions)

Alter validation constraint plugin definitions.

Parameters

array[] $definitions: The array of validation constraint definitions, keyed by plugin ID.

See also

\Drupal\Core\Validation\ConstraintManager

\Drupal\Core\Validation\Annotation\Constraint

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/core.api.php, line 2249
Documentation landing page and topics, plus core library hooks.

Code

function hook_validation_constraint_alter(array &$definitions) {
  $definitions['Null']['class'] = '\Drupal\mymodule\Validator\Constraints\MyClass';
}
doc_Drupal
2016-10-29 09:18:37
Comments
Leave a Comment

Please login to continue.