SearchPageAddForm::buildForm

public SearchPageAddForm::buildForm(array $form, FormStateInterface $form_state, $search_plugin_id = NULL)

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

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

Return value

array The form structure.

Overrides SearchPageFormBase::buildForm

File

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

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);
}
doc_Drupal
2016-10-29 09:40:25
Comments
Leave a Comment

Please login to continue.