Download the PHP package ikkez/f3-middleware without Composer
On this page you can find all versions of the php package ikkez/f3-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ikkez/f3-middleware
More information about ikkez/f3-middleware
Files in ikkez/f3-middleware
Package f3-middleware
Short Description A middleware router plugin for PHP Fat-Free Framework
License GPL-3.0
Homepage https://github.com/ikkez/f3-middleware
Informations about the package f3-middleware
Middleware Router
This is a middleware router for PHP Fat-Free-Framework, version 3.x
It's based on the F3 core router, that can be called independently before or after the main routing cycle. This can be useful if you want to hook into a group of other routes and want to do something right before processing the main route handler.
Installation
-
Method 1: use composer composer require ikkez/f3-middleware
- Method 2: copy the
middleware.php
file into your F3lib/
directory or another directory that is known to the AUTOLOADER
Usage Samples
Of course you could also use the beforeroute
and afterroute
events in your controller to add that auth check functionality. But in case your controller structure isn't ready yet for easy implementation or you have things you strictly want to separate from your controllers, like settings. Here the Middleware Router will aid you.
You can also create additional middleware wrappers on other events:
Notice
Although you can probably use the middleware router as a completely stand alone router, it is not a full replacement of the frameworks integrated router. The middleware router does not include handling of route caching, header management or automated CORS support, so use it as an additional component for settings, checks and workload before/after the main routing cycle.
License
You are allowed to use this plugin under the terms of the GNU General Public License version 3 or later.
Copyright (C) 2019 Christian Knuth (ikkez)