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

Middleware Changes?

lonny's Avatar

lonny

18 Jul, 2012 03:26 PM

I was just looking at the Slim Docs and I think the docs for Middleware have changed.

I remember seeing syntax similar to the one described in http://help.slimframework.com/discussions/questions/273-route-helpe...

Did I miss this syntax in the docs? If not, is the old syntax deprecated?

  1. Support Staff 1 Posted by Brian Nesbitt on 21 Jul, 2012 03:44 AM

    Brian Nesbitt's Avatar

    Not sure what part of the documentation you are referring to???

    There is the <5.3 and >=5.3 way of defining route middleware callable's. When defining a route the first argument is the pattern, the last argument is the route callable and any arguments in between (ie. the middle) are middleware callables.

  2. 2 Posted by lonny on 22 Jul, 2012 06:51 PM

    lonny's Avatar

    Brian,

    I am not seeing the syntax you described in the docs on middleware.

    All I see is the syntax for using $app->add( middleware );

  3. Support Staff 3 Posted by Brian Nesbitt on 23 Jul, 2012 12:13 AM

    Brian Nesbitt's Avatar

    Ah... yes gotcha now.

    That is the difference between middleware which runs on all requested routes and route middleware which is associated to only a specific route. Of course the same route middleware can be reused on multiple routes.

    Middleware

    Route Middleware

  4. 4 Posted by lonny on 24 Jul, 2012 08:02 PM

    lonny's Avatar

    Oh, I see. I must have missed that. Thank you for the links!

  5. Support Staff 5 Posted by Brian Nesbitt on 25 Jul, 2012 03:03 AM

    Brian Nesbitt's Avatar

    No problem!

  6. Brian Nesbitt closed this discussion on 25 Jul, 2012 03:03 AM.

Comments are currently closed for this discussion. You can start a new one.

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