You are here

public function NodeImportForm::buildForm in Node export 8

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

File

src/Form/NodeImportForm.php, line 23

Class

NodeImportForm
Provides a Node Import form.

Namespace

Drupal\node_Export\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['paste'] = [
    '#type' => 'textarea',
    '#title' => 'Exported Code',
    '#default_value' => '',
    '#rows' => 15,
    '#description' => $this
      ->t('Paste the code of a node export here and check that new nodes are created or not after clicking on content.'),
    '#wysiwyg' => FALSE,
    '#required' => TRUE,
  ];
  $form['actions'] = [
    '#type' => 'actions',
  ];
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Import'),
  ];
  return $form;
}