You are here

public function OrganigramsImportD7Form::buildForm in Organigrams 8.2

Same name and namespace in other branches
  1. 8 src/Form/OrganigramsImportD7Form.php \Drupal\organigrams\Form\OrganigramsImportD7Form::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 FormInterface::buildForm

File

src/Form/OrganigramsImportD7Form.php, line 38

Class

OrganigramsImportD7Form
Provides the settings form for this module.

Namespace

Drupal\organigrams\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  // Node templates in JSON.
  $form['organigrams_d7_json'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Drupal 7 organigram JSON'),
    '#description' => '',
    '#required' => TRUE,
    '#rows' => 20,
  ];

  // Group submit handlers in an actions element with a key of "actions".
  $form['actions'] = [
    '#type' => 'actions',
  ];

  // Add a submit button that handles the submission of the form.
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Submit'),
  ];
  return $form;
}