Which is the best way to use middleware ?
Hi author, Hi everybody,
Could you please tell me the best way to use the middleware (fast + professional + standardized) by this framework?
Thanks, Vic P.
Just use the before and after methods and register your own functions as middleware. If you want a more extensive setup you can try something like https://github.com/AndrewPodner/flight-MVC.
@mikecao Sorry to bring up an old thread but I had a similar question. I know I need to use a before filter to implement a before middleware, but I don't know which hook to pick.
Let's say I wanted to add csrf protection for post requests. Which hook would I add a before filter to, to inspect the request method, and check for a crsf token when it's POST?
@carc1n0gen I did it time ago. Take a look at my sample/template project https://github.com/vic4key/sample.git @mikecao I designed it based on your nice framework. Any comment for it if you are free? Thanks.
Currently being worked on with latest update #514.