fapi_validation.module in Form API Validation 8.2
Same filename and directory in other branches
Form API validation module.
File
fapi_validation.moduleView source
<?php
/**
* @file
* Form API validation module.
*/
/**
* Implements hook_element_info_alter().
*
* PURPOSE: Add fapi validation element processing to all form elements.
*/
function fapi_validation_element_info_alter(array &$info) {
// Loop through all form element types and only hit input variants.
foreach ($info as $type_name => $type_info) {
if (isset($type_info['#input']) && $type_info['#input']) {
// Processes the form element on form creation.
$info[$type_name]['#process'][] = '\\Drupal\\fapi_validation\\FapiValidationService::process';
}
}
}
Functions
Name | Description |
---|---|
fapi_validation_element_info_alter | Implements hook_element_info_alter(). |