You are here

protected function ViewsBulkOperationsFormTrait::addCancelButton in Views Bulk Operations (VBO) 8.2

Same name and namespace in other branches
  1. 8.3 src/Form/ViewsBulkOperationsFormTrait.php \Drupal\views_bulk_operations\Form\ViewsBulkOperationsFormTrait::addCancelButton()
  2. 4.0.x src/Form/ViewsBulkOperationsFormTrait.php \Drupal\views_bulk_operations\Form\ViewsBulkOperationsFormTrait::addCancelButton()

Add a cancel button into a VBO form.

Parameters

array $form: The form definition.

2 calls to ViewsBulkOperationsFormTrait::addCancelButton()
ConfigureAction::buildForm in src/Form/ConfigureAction.php
Form constructor.
ConfirmAction::buildForm in src/Form/ConfirmAction.php
Form constructor.

File

src/Form/ViewsBulkOperationsFormTrait.php, line 172

Class

ViewsBulkOperationsFormTrait
Defines common methods for Views Bulk Operations forms.

Namespace

Drupal\views_bulk_operations\Form

Code

protected function addCancelButton(array &$form) {
  $form['actions']['cancel'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Cancel'),
    '#submit' => [
      [
        $this,
        'cancelForm',
      ],
    ],
    '#limit_validation_errors' => [],
  ];
}