You are here

public function PostDeleteForm::getRedirectUrl in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  2. 8 modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  3. 8.2 modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  4. 8.3 modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  5. 8.4 modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  6. 8.6 modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  7. 8.7 modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  8. 8.8 modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  9. 10.3.x modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  10. 10.0.x modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  11. 10.1.x modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()
  12. 10.2.x modules/social_features/social_post/src/Form/PostDeleteForm.php \Drupal\social_post\Form\PostDeleteForm::getRedirectUrl()

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

Return value

\Drupal\Core\Url The redirect URL.

Overrides EntityDeleteFormTrait::getRedirectUrl

File

modules/social_features/social_post/src/Form/PostDeleteForm.php, line 39

Class

PostDeleteForm
Provides a form for deleting Post entities.

Namespace

Drupal\social_post\Form

Code

public function getRedirectUrl() {

  // Set the redirect url to the destination in the url.
  if (\Drupal::request()->query
    ->has('destination')) {
    $destination = \Drupal::destination();
    $path = $destination
      ->get();
    return Url::fromUserInput($path);
  }

  // Default to the stream page.
  return Url::fromRoute('social_core.homepage');
}