You are here

protected function ComponentSectionForm::actions in Module Builder 8.3

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

Overrides EntityForm::actions

1 call to ComponentSectionForm::actions()
ModuleNameForm::actions in src/Form/ModuleNameForm.php
Returns an array of supported actions for the current entity form.
1 method overrides ComponentSectionForm::actions()
ModuleNameForm::actions in src/Form/ModuleNameForm.php
Returns an array of supported actions for the current entity form.

File

src/Form/ComponentSectionForm.php, line 1529

Class

ComponentSectionForm
Generic form for entering a section of data for a component.

Namespace

Drupal\module_builder\Form

Code

protected function actions(array $form, FormStateInterface $form_state) {

  // TODO: remove #mb_action, use #name instead.
  $actions['submit'] = array(
    '#type' => 'submit',
    '#value' => $this
      ->t('Save'),
    '#dropbutton' => 'mb',
    // Still no way to get a button's name, apparently?
    '#mb_action' => 'submit',
    '#submit' => array(
      '::submitForm',
      '::save',
    ),
  );
  if ($this
    ->getNextLink() != 'generate-form') {
    $actions['submit_next'] = array(
      '#type' => 'submit',
      '#value' => $this
        ->t('Save and go to next page'),
      '#dropbutton' => 'mb',
      '#mb_action' => 'submit_next',
      '#submit' => array(
        '::submitForm',
        '::save',
      ),
    );
  }
  $actions['submit_generate'] = array(
    '#type' => 'submit',
    '#value' => $this
      ->t('Save and generate code'),
    '#dropbutton' => 'mb',
    '#mb_action' => 'submit_generate',
    '#submit' => array(
      '::submitForm',
      '::save',
    ),
  );
  return $actions;
}