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. What is?

Middleware

In PHP, a middleware is a piece of code that operates between the incoming HTTP request and the corresponding application logic. It allows developers to perform actions before the request reaches the main application or after the response is generated. Middlewares are commonly used in MaplePHP, to handle tasks like authentication, logging, or modifying the request/response.

When a request is made, it passes through a series of middlewares that can intercept, modify, or enhance the request or response. This modular approach simplifies the organization of code and promotes reusability. Middlewares can be chained together to create a pipeline of processing steps, providing a flexible and extensible way to handle various aspects of web application functionality.

PreviousControllerNextRouter

Last updated 1 year ago

Was this helpful?