Does Slim have a "requestComplete" handler?

For an app I’m writing I need to do some stuff at the end of a successful (ie: no errors were thrown/caught) request … does slim have something predefined for this so that you can do something like this:

$container['requestCompleteHandler'] = .....

or should I just add this after

$app->run()

However, if I add it after $app->run(), will it also get executed after the ‘errorHandler’ is called? So what is the proper way of handling this?

I believe you can easily implement that yourself with a middleware. Take a look at https://www.slimframework.com/docs/concepts/middleware.html

Yes, that is most certainly true (in all honesty, I was too wrapped up thinking about the details of what I have to do that I forgot about the middleware possibilities). Thanks for reminding me :slight_smile: