Slim-Website icon indicating copy to clipboard operation
Slim-Website copied to clipboard

Explain the ability to use PSR-15 middleware

Open carlosmintfan opened this issue 1 year ago • 4 comments

https://www.slimframework.com/docs/v4/concepts/middleware.html talks about closures and invokable classes as middlewares. However, instead of writing a class with an __invoke() method, you could also write a class with a process() instead of an __invoke() method if it implements \PSR\Http\Server\MiddlewareInterface. That should be explained.

carlosmintfan avatar May 25 '24 21:05 carlosmintfan

The page about routing already explains that you can implement a class with a __invoke() method as a rote handler. But this invokable class is not a middleware. How middlewares can be implemented can be found on this page.

odan avatar Jun 30 '24 14:06 odan

The middleware page doesn't talk about psr-15 middlewares with a process method. Oh, the routing link was an error, I think. I'm talking about middleware :)

carlosmintfan avatar Jun 30 '24 18:06 carlosmintfan

Yes, this part about PSR-15 middlewares with a process method is missing.

@akrabat Maybe we should reconsider this PR again: https://github.com/slimphp/Slim-Website/pull/662

odan avatar Jun 30 '24 22:06 odan

Yes, this part about PSR-15 middlewares with a process method is missing.

@akrabat Maybe we should reconsider this PR again: #662

Yes, I agree.

akrabat avatar Jul 01 '24 08:07 akrabat