You are here

protected function MediaEditForm::buildActions in Media Directories 8

Same name and namespace in other branches
  1. 3.x modules/media_directories_ui/src/Form/MediaEditForm.php \Drupal\media_directories_ui\Form\MediaEditForm::buildActions()
  2. 2.x modules/media_directories_ui/src/Form/MediaEditForm.php \Drupal\media_directories_ui\Form\MediaEditForm::buildActions()

Returns an array of supported actions for the form.

Parameters

array $form: The complete form.

\Drupal\Core\Form\FormStateInterface $form_state: The current form state.

Return value

array An actions element containing the actions of the form.

Overrides AddMediaFormBase::buildActions

File

modules/media_directories_ui/src/Form/MediaEditForm.php, line 180

Class

MediaEditForm
Class MediaEditForm.

Namespace

Drupal\media_directories_ui\Form

Code

protected function buildActions(array $form, FormStateInterface $form_state) {
  return [
    '#type' => 'actions',
    'save' => [
      '#type' => 'submit',
      '#button_type' => 'primary',
      '#value' => $this
        ->t('Save'),
      '#ajax' => [
        'callback' => [
          get_called_class(),
          'saveMedia',
        ],
        'wrapper' => 'media-library-add-form-wrapper',
      ],
    ],
  ];
}