示例#1
0
 /**
  * Test middleware with arguments
  */
 public function testRouteMiddlwareArguments()
 {
     $this->expectOutputString('foobar');
     $route = new \Slim\Route('/foo', function () {
         echo "bar";
     });
     $route->setName('foo');
     $route->setMiddleware(function ($route) {
         echo $route->getName();
     });
     $route->matches('/foo');
     //<-- Extracts params from resource URI
     $route->dispatch();
 }