class Search

Processes the "search" element.

Plugin annotation

@BootstrapProcess("search")

Hierarchy

Expanded class hierarchy of Search

Related topics

4 string references to 'Search'
block.block.bootstrap_search.yml in config/optional/block.block.bootstrap_search.yml
config/optional/block.block.bootstrap_search.yml
Bootstrap::cssClassFromString in src/Bootstrap.php
Matches a Bootstrap class based on a string value.
Bootstrap::glyphiconFromString in src/Bootstrap.php
Matches a Bootstrap Glyphicon based on a string value.
Search::processElement in src/Plugin/Process/Search.php
Process a specific form element.

Namespace

Drupal\bootstrap\Plugin\Process
Source
class Search extends ProcessBase implements ProcessInterface {

  /**
   * {@inheritdoc}
   */
  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.'));
    }
  }

}

Members

Contains filters are case sensitive
Name Modifiers Type Description
PluginBase::$theme protected property The currently set theme object.
PluginBase::__construct public function
ProcessBase::process public static function Process a specific form element type. Overrides ProcessInterface::process
Search::processElement public static function Process a specific form element. Overrides ProcessBase::processElement