MaplePHP
  • MaplePHP - Layered structure MVC PHP framework
  • Guide
    • Get started
    • Installation
    • Service Provider
    • Dependency injector
    • Controller
    • Middlewares
    • Routers
  • Navigation
    • Simple navigation
    • Dynamic navigation
  • Template engine
    • Getting started
    • Templates
      • Index
      • Views
      • Partials
    • Content (DTO)
      • String
      • Number
      • Array
      • DateTime
      • Encode
      • Dom
  • Form builder
    • Form builder
  • Database
    • MySQL
  • Service providers
    • url
    • encode
    • dir
    • DB
    • responder
  • Installations
    • Authorization & login
  • Frontend template
    • Responder
    • Views & components
    • Modals
    • Redirects
  • Access
    • MaplePHP with Docker
  • Libraries
    • Container
    • MySQL queries
    • Validation
    • Cache
    • Logger
    • Request
    • Response
  • What is?
    • Dependency injector
    • Controller
    • Middleware
    • Router
Powered by GitBook
On this page

Was this helpful?

  1. Frontend template

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");
PreviousModalsNextMaplePHP with Docker

Last updated 1 year ago

Was this helpful?