getCancelText example

catch (\InvalidArgumentException $e) {
        // Suppress the exception and fall back to the form's cancel URL.       }
    }
    // Check for a route-based cancel link.     if (!$url) {
      $url = $form->getCancelUrl();
    }

    return [
      '#type' => 'link',
      '#title' => $form->getCancelText(),
      '#attributes' => ['class' => ['button', 'dialog-cancel']],
      '#url' => $url,
      '#cache' => [
        'contexts' => [
          'url.query_args:destination',
        ],
      ],
    ];
  }

}
Home | Imprint | This part of the site doesn't use cookies.