You are here

public function ContentSingleImportForm::buildForm in Content Synchronization 8

Same name and namespace in other branches
  1. 8.2 src/Form/ContentSingleImportForm.php \Drupal\content_sync\Form\ContentSingleImportForm::buildForm()
  2. 3.0.x src/Form/ContentSingleImportForm.php \Drupal\content_sync\Form\ContentSingleImportForm::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/ContentSingleImportForm.php, line 24

Class

ContentSingleImportForm
Provides a form for importing a single content file.

Namespace

Drupal\content_sync\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['import'] = array(
    '#title' => $this
      ->t('Paste your content here'),
    '#type' => 'textarea',
    '#rows' => 24,
    '#required' => TRUE,
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => $this
      ->t('Import'),
    '#button_type' => 'primary',
  );
  return $form;
}