You are here

public function ServiceResourceBaseForm::buildForm in Services 8.4

Same name and namespace in other branches
  1. 9.0.x src/Form/ServiceResourceBaseForm.php \Drupal\services\Form\ServiceResourceBaseForm::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 EntityForm::buildForm

File

src/Form/ServiceResourceBaseForm.php, line 17

Class

ServiceResourceBaseForm
Class \Drupal\services\Form\ServiceResourceBaseForm.

Namespace

Drupal\services\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $service_endpoint = NULL, $plugin_id = NULL) {
  $form = parent::buildForm($form, $form_state);
  $form['service_plugin_id'] = [
    '#type' => 'value',
    '#value' => $plugin_id,
  ];
  $form['service_endpoint_id'] = [
    '#type' => 'value',
    '#value' => $service_endpoint
      ->id(),
  ];
  return $form;
}