function DevelGenerateForm::buildForm

Same name in other branches
  1. 4.x devel_generate/src/Form/DevelGenerateForm.php \Drupal\devel_generate\Form\DevelGenerateForm::buildForm()

Overrides FormInterface::buildForm

File

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

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) : array {
    $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;
}