MenuLinkContentDeleteForm.php in Drupal 9
File
core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php
View source
<?php
namespace Drupal\menu_link_content\Form;
use Drupal\Core\Entity\ContentEntityDeleteForm;
use Drupal\Core\Url;
class MenuLinkContentDeleteForm extends ContentEntityDeleteForm {
public function getCancelUrl() {
if ($this->moduleHandler
->moduleExists('menu_ui')) {
return new Url('entity.menu.edit_form', [
'menu' => $this->entity
->getMenuName(),
]);
}
return $this->entity
->toUrl();
}
protected function getRedirectUrl() {
return $this
->getCancelUrl();
}
protected function getDeletionMessage() {
return $this
->t('The menu link %title has been deleted.', [
'%title' => $this->entity
->label(),
]);
}
}