public function SearchPageAddForm::buildForm in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/search/src/Form/SearchPageAddForm.php \Drupal\search\Form\SearchPageAddForm::buildForm()
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 20 - Contains \Drupal\search\Form\SearchPageAddForm.
Class
- SearchPageAddForm
- Provides a form for adding a search page.
Namespace
Drupal\search\FormCode
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);
}