You are here

protected function ModuleNameForm::actions in Module Builder 8.3

Returns an array of supported actions for the current entity form.

Overrides ComponentSectionForm::actions

File

src/Form/ModuleNameForm.php, line 73

Class

ModuleNameForm
Form for editing basic information, and also for adding new module entities.

Namespace

Drupal\module_builder\Form

Code

protected function actions(array $form, FormStateInterface $form_state) {
  $actions = parent::actions($form, $form_state);
  if ($this->entity
    ->isNew()) {
    $button = $actions['submit'];
    $button['#value'] = $this
      ->t('Save basic information');

    // Babysit core bug: dropbutton with only one item looks wrong.
    unset($button['#dropbutton']);
    $actions = [
      'submit' => $button,
    ];
  }
  return $actions;
}