You are here

public function CustomContextualLinkDeleteForm::form in Custom Contextual Links 8.2

Gets the actual form array to be built.

Overrides EntityForm::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

File

src/Form/CustomContextualLinkDeleteForm.php, line 40

Class

CustomContextualLinkDeleteForm
Builds the form to delete Custom Contextual Link entities.

Namespace

Drupal\ccl\Form

Code

public function form(array $form, FormStateInterface $form_state) {
  $form = parent::form($form, $form_state);

  // Add library and class in order to clear the sessionStorage upon deletion.
  $form['#attached']['library'][] = 'ccl/ccl';
  $form['#attributes']['class'][] = 'ccl-form';
  return $form;
}