Provides an API for extending HotMelt's request handling machinery.
Middleware can register for hooks to intercept requests.
__construct()
The default implementation does not take any arguments.
registerMiddleware() : void
registerHook(string $name, callable $callback) : void
You must only call this function from within the register() method of your middleware subclass.
Strictly speaking the middleware hook facility is not limited to subclasses of \HotMelt\Middleware.
Note, however, that registering a callback through this function in any other context than the register() method is not officially supported.
stringThe hook to register for.
callableThe callback to execute for the hook.
executeHook(string $name) : array
Additional parameters passed to this method are passed on to registered callbacks.
stringThe name of hook for which to execute registered callbacks.
arrayThe data accumulated by executing all registered callbacks.
add(string $name)
Additional parameters passed to this method are passed on to the middleware constructor.
stringThe class name of the middleware to add.