function claro_form_views_exposed_form_alter in Drupal 8
Same name and namespace in other branches
- 9 core/themes/claro/claro.theme \claro_form_views_exposed_form_alter()
Implements hook_form_FORM_ID_alter() for views_exposed_form.
File
- core/
themes/ claro/ claro.theme, line 646 - Functions to support theming in the Claro theme.
Code
function claro_form_views_exposed_form_alter(&$form, FormStateInterface $form_state) {
$view = $form_state
->getStorage()['view'];
$view_title = $view
->getTitle();
// Add a label so screenreaders can identify the purpose of the exposed form
// without having to scan content that appears further down the page.
$form['#attributes']['aria-label'] = t('Filter the contents of the %view_title view', [
'%view_title' => $view_title,
]);
}