file SearchForm.php

Namespace

Drupal\bootstrap\Plugin\Form
  1. <?php
  2. namespace Drupal\bootstrap\Plugin\Form;
  3. use Drupal\bootstrap\Utility\Element;
  4. use Drupal\Core\Form\FormStateInterface;
  5. /**
  6. * Implements hook_form_FORM_ID_alter().
  7. *
  8. * @ingroup plugins_form
  9. *
  10. * @BootstrapForm("search_form")
  11. */
  12. class SearchForm extends FormBase {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
  17. $form->advanced->setProperty('collapsible', TRUE);
  18. $form->advanced->setProperty('collapsed', TRUE);
  19. $form->basic->removeClass('container-inline');
  20. $form->basic->submit->setProperty('icon_only', TRUE);
  21. $form->basic->keys->setProperty('input_group_button', TRUE);
  22. }
  23. }

Classes

Name Description
SearchForm Implements hook_form_FORM_ID_alter().