You are here

protected function GroupContentMenuDeleteForm::getRedirectUrl in Group Content Menu 8

Returns the URL where the user should be redirected after deletion.

Return value

\Drupal\Core\Url The redirect URL.

Overrides EntityDeleteFormTrait::getRedirectUrl

File

src/Form/GroupContentMenuDeleteForm.php, line 18

Class

GroupContentMenuDeleteForm
Form controller for Group menu instance edit forms.

Namespace

Drupal\group_content_menu\Form

Code

protected function getRedirectUrl() {
  $group = \Drupal::routeMatch()
    ->getParameter('group');
  if ($group) {
    return Url::fromRoute('entity.group_content_menu.collection', [
      'group' => $group
        ->id(),
    ]);
  }
  return Url::fromRoute('<front>');
}