function classy_form_alter

Same name in other branches
  1. 8.9.x core/themes/classy/classy.theme \classy_form_alter()

Implements hook_form_alter().

File

core/themes/classy/classy.theme, line 33

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';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.