The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

Route Middleware for All Routes

K. Long's Avatar

K. Long

30 May, 2012 01:03 AM

Is it possible to have route middleware called for all routes? A few examples of this would be authenticating OAuth header information or logging the route request to a database table. I know it can be done by explicitly putting the route middleware in each routing call, but wasn't sure if there was a way around this.

  1. Support Staff 1 Posted by Josh Lockhart on 03 Jun, 2012 07:27 PM

    Josh Lockhart's Avatar

    Yes. You can write your own custom middleware or use the slim.before application hook.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac