You are here

function classy_form_alter in Drupal 8

Same name and namespace in other branches
  1. 9 core/themes/classy/classy.theme \classy_form_alter()

Implements hook_form_alter().

File

core/themes/classy/classy.theme, line 29
Functions to support theming in the Classy theme.

Code

function classy_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
  $form_object = $form_state
    ->getFormObject();
  if ($form_object instanceof ViewsForm && strpos($form_object
    ->getBaseFormId(), 'views_form_media_library') === 0) {
    $form['#attributes']['class'][] = 'media-library-views-form';
  }
}