Skip to main content
2 of 4
Added a reference.

Redirect:

// Drupal\Core\Url; // Symfony\Component\HttpFoundation\RedirectResponse; $url = Url::fromUri('internal:/'); $response = new RedirectResponse($url->toString()); $response->send();


**Messeges using static service:**

\Drupal::messenger()->addStatus($message);


**Other equivalents:**

addMessage(), addError(), addWarning().


**References:**

RedirectResponse

Url

Drupal::messenger

MessengerInterface