/** * html like urls * * @return Route */ private function sampleRole() { //Custom application routes can be located here (this one: /twig.html, /index.html). $route = new Route('home', '<action>.html', 'Controllers\\HomeController::<action>'); //Middlewares can be registered as closure, class name or anything callable return $route->withMiddleware([function ($request, $response, $next) { return $next($request, $response)->withHeader('My-Header', 'Yay!'); }, CsrfFilter::class]); }