function MenuLinkContentDeleteForm::getCancelUrl

Same name in other branches
  1. 9 core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php \Drupal\menu_link_content\Form\MenuLinkContentDeleteForm::getCancelUrl()
  2. 8.9.x core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php \Drupal\menu_link_content\Form\MenuLinkContentDeleteForm::getCancelUrl()
  3. 10 core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php \Drupal\menu_link_content\Form\MenuLinkContentDeleteForm::getCancelUrl()

Overrides ContentEntityDeleteForm::getCancelUrl

1 call to MenuLinkContentDeleteForm::getCancelUrl()
MenuLinkContentDeleteForm::getRedirectUrl in core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php
Returns the URL where the user should be redirected after deletion.

File

core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php, line 18

Class

MenuLinkContentDeleteForm
Provides a delete form for content menu links.

Namespace

Drupal\menu_link_content\Form

Code

public function getCancelUrl() {
    if ($this->moduleHandler
        ->moduleExists('menu_ui')) {
        return new Url('entity.menu.edit_form', [
            'menu' => $this->entity
                ->getMenuName(),
        ]);
    }
    return $this->entity
        ->toUrl();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.