/** * {@inheritdoc} */ public function form(array $form, FormStateInterface $form_state) { $form['label'] = array('#type' => 'textfield', '#title' => $this->t('Label'), '#description' => $this->t('The label for this search page.'), '#default_value' => $this->entity->label(), '#maxlength' => '255'); $form['id'] = array('#type' => 'machine_name', '#default_value' => $this->entity->id(), '#disabled' => !$this->entity->isNew(), '#maxlength' => 64, '#machine_name' => array('exists' => array($this, 'exists'))); $form['path'] = array('#type' => 'textfield', '#title' => $this->t('Path'), '#field_prefix' => 'search/', '#default_value' => $this->entity->getPath(), '#maxlength' => '255', '#required' => TRUE); $form['plugin'] = array('#type' => 'value', '#value' => $this->entity->get('plugin')); if ($this->plugin instanceof PluginFormInterface) { $form += $this->plugin->buildConfigurationForm($form, $form_state); } return parent::form($form, $form_state); }