Download the PHP package idealogica/route-one without Composer
On this page you can find all versions of the php package idealogica/route-one. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download idealogica/route-one
More information about idealogica/route-one
Files in idealogica/route-one
Package route-one
Short Description PSR-15 route middleware for advanced middleware routing.
License MIT
Informations about the package route-one
route-one - PSR-15 route middleware for advanced middleware routing
The package is in the beta stage
route-one
is a PSR-15 compatible middleware aimed to
flexibly route a request to another middleware based on HTTP request url path, host, http method, etc.
It is built on top of Middleman and Aura.Router packages.
It's a good addition to your favorite middleware dispatcher to feel it more likely classical request router.
This package also contains a middleware dispatcher that has bunch of useful methods for easy creating route middleware instances.
route-one
is very similar to classic controller routers from every modern framework, but it has some more advantages:
- Standard compliant. You can use any PSR-15 compatible middleware. For example any of these: middlewares/psr15-middlewares.
- Allows to build multi-dimensional routes and modify response from a group of middleware.
- It makes your code highly reusable. Any part of the web resource can be bundled as a separate packaged middleware and used in other projects.
Installation
General usage
As you can see you can use callable as middleware. It is not a part of PSR-15 but it can be very helpful for quick prototyping.
Also you can use the route middleware separately with your own dispatcher:
For more information on routing rules configuration please refer to Aura.Router routes documentation.
Uri generation
You can use generator to create URIs based or your named routes. Example for the code above:
For more information on URIs generation please refer to Aura.Router generator documentation.
License
route-one is licensed under a MIT License.
All versions of route-one with dependencies
aura/router Version ~3.1
psr/http-message Version ~1.0
psr/container Version ~1.0
mindplay/middleman Version ~3.0.3
psr/http-server-middleware Version ~1.0.1
psr/http-server-handler Version ~1.0.1