You are here

public function DevelGenerateForm::buildForm in Devel 8

Same name and namespace in other branches
  1. 8.3 devel_generate/src/Form/DevelGenerateForm.php \Drupal\devel_generate\Form\DevelGenerateForm::buildForm()
  2. 8.2 devel_generate/src/Form/DevelGenerateForm.php \Drupal\devel_generate\Form\DevelGenerateForm::buildForm()
  3. 4.x devel_generate/src/Form/DevelGenerateForm.php \Drupal\devel_generate\Form\DevelGenerateForm::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

devel_generate/src/Form/DevelGenerateForm.php, line 76

Class

DevelGenerateForm
Defines a form that allows privileged users to generate entities.

Namespace

Drupal\devel_generate\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $plugin_id = $this
    ->getPluginIdFromRequest();
  $instance = $this
    ->getPluginInstance($plugin_id);
  $form = $instance
    ->settingsForm($form, $form_state);
  $form['actions'] = [
    '#type' => 'actions',
  ];
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Generate'),
    '#button_type' => 'primary',
  ];
  return $form;
}