function SearchPageAddForm::buildForm

Same name in other branches
  1. 8.9.x core/modules/search/src/Form/SearchPageAddForm.php \Drupal\search\Form\SearchPageAddForm::buildForm()
  2. 10 core/modules/search/src/Form/SearchPageAddForm.php \Drupal\search\Form\SearchPageAddForm::buildForm()
  3. 11.x core/modules/search/src/Form/SearchPageAddForm.php \Drupal\search\Form\SearchPageAddForm::buildForm()

Overrides SearchPageFormBase::buildForm

File

core/modules/search/src/Form/SearchPageAddForm.php, line 17

Class

SearchPageAddForm
Provides a form for adding a search page.

Namespace

Drupal\search\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $search_plugin_id = NULL) {
    $this->entity
        ->setPlugin($search_plugin_id);
    $definition = $this->entity
        ->getPlugin()
        ->getPluginDefinition();
    $this->entity
        ->set('label', $definition['title']);
    return parent::buildForm($form, $form_state);
}

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