function claro_preprocess_form_element
Same name in other branches
- 9 core/themes/claro/claro.theme \claro_preprocess_form_element()
- 10 core/themes/claro/claro.theme \claro_preprocess_form_element()
- 11.x core/themes/claro/claro.theme \claro_preprocess_form_element()
Implements hook_preprocess_form_element().
File
-
core/
themes/ claro/ claro.theme, line 658
Code
function claro_preprocess_form_element(&$variables) {
if (!empty($variables['element']['#errors'])) {
$variables['label']['#attributes']['class'][] = 'has-error';
}
if ($variables['disabled']) {
$variables['label']['#attributes']['class'][] = 'is-disabled';
if (!empty($variables['description']['attributes'])) {
$variables['description']['attributes']->addClass('is-disabled');
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.