You are here

public function RestExampleClientDelete::buildForm in Examples for Developers 3.x

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 ConfirmFormBase::buildForm

File

modules/rest_example/src/Form/RestExampleClientDelete.php, line 83

Class

RestExampleClientDelete
Delete a new node on a remote Drupal site.

Namespace

Drupal\rest_example\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $id = NULL) {
  $form = parent::buildForm($form, $form_state);
  $form_state
    ->set('node_id', $id);
  return $form;
}