You are here

public static function Search::processElement in Express 8

Process a specific form element.

Parameters

\Drupal\bootstrap\Utility\Element $element: The element object.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

array $complete_form: The complete form structure.

Overrides ProcessBase::processElement

See also

\Drupal\bootstrap\Plugin\Process\ProcessBase::process()

\Drupal\bootstrap\Plugin\Alter\ElementInfo::alter()

File

themes/contrib/bootstrap/src/Plugin/Process/Search.php, line 25
Contains \Drupal\bootstrap\Plugin\Process\Search.

Class

Search
Processes the "search" element.

Namespace

Drupal\bootstrap\Plugin\Process

Code

public static function processElement(Element $element, FormStateInterface $form_state, array &$complete_form) {
  $element
    ->setProperty('title_display', 'invisible');
  $element
    ->setAttribute('placeholder', $element
    ->getProperty('placeholder', $element
    ->getProperty('title', t('Search'))));
  if (!$element
    ->hasProperty('description')) {
    $element
      ->setProperty('description', t('Enter the terms you wish to search for.'));
  }
}