You are here

public function Example1::buildForm in Multiple forms 8

.

Overrides FormInterface::buildForm

File

multiform_example/src/Form/Example1.php, line 22
Contains \Drupal\multiform_example\Form\Example1.

Class

Example1

Namespace

Drupal\multiform_example\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['text_field_1'] = array(
    '#type' => 'textfield',
    '#title' => 'Text field 1',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Save',
  );
  $form['delete'] = array(
    '#type' => 'submit',
    '#value' => 'Delete',
    '#submit' => array(
      '::multiformTestDelete',
    ),
  );
  return $form;
}