Download the PHP package tobento/service-middleware without Composer
On this page you can find all versions of the php package tobento/service-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tobento/service-middleware
More information about tobento/service-middleware
Files in tobento/service-middleware
Package service-middleware
Short Description A PSR-15 middleware dispatcher with autowiring and alias support.
License MIT
Homepage https://www.tobento.ch
Informations about the package service-middleware
Middleware Service
A PSR-15 middleware dispatcher with autowiring and alias support.
Table of Contents
- Getting started
- Requirements
- Highlights
- Documentation
- Creating Middleware Dispatcher
- Adding Middleware
- Aliases
- Groups
- Stack Priority
- Dispatch
- Credits
Getting started
Add the latest version of the middleware service running this command.
Requirements
- PHP 8.0 or greater
Highlights
- Framework-agnostic, will work with any project
- Decoupled design
- Autowiring middlewares
- Aliasing middlewares
Documentation
Creating Middleware Dispatcher
new
You may use the method to create a new instance. It will keep the added aliases though.
Adding Middleware
By anonymous function:
By class instance:
By class name:
By class name with build-in parameters (not resolvable by autowiring):
Adding multiple at once:
Aliases
You might want to use aliases instead of class names:
Groups
You might want to add a group of middlewares:
Stack Priority
You might want to prioritize the excution order of the middlewares by the following way:
Dispatch
Credits
- Tobias Strub
- All Contributors
All versions of service-middleware with dependencies
psr/http-message Version ^1.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/container Version ^2.0
tobento/service-autowire Version ^1.0