Redirects

You can also trigger different kinds of redirects utilizing the Responder.

Redirects

Reload current page

This will reload the current URL.

$this->provider->responder()->reload();

Redirect page

This will redirect to specified URL.

$this->provider->responder()->redirect("https://example.se/page-1");

OK Reload modal

This will reload the current URL when the user clicks a OK button in a modal with message.

$this->provider->responder()->okReload("The page will reload");

OK redirect modal

This will redirect to specified URL when the user clicks a OK button in a modal with message.

$this->provider->responder()->okRedirect("You will be redirected", "https://example.se/page-1");

Confirm Reload modal

Will reload the page if the user clicks a OK button in a modal with message. If user clicks "Cancel" button then it will do nothing.

$this->provider->responder()->confirmReload("Do you want to reload the page?");

Confirm redirect modal

Will redirect the page to specified URL if the user clicks a OK button in a modal with message. If user clicks "Cancel" button then it will do nothing.

$this->provider->responder()->confirmRedirect("Do you want to be redirected?", "https://example.se/page-1");

Last updated