コード例 #1
0
 /**
  * @depends clone testDefault
  */
 public function testNonGroup(Router $router)
 {
     $router->default()->path_prefix('users/{user}/')->param_sources(['user' => 'uri', 'item_name' => 'uri', 'item_property' => 'post', 'sort' => 'get', 'top' => 'get']);
     $router->options('/profiles', function () {
         return ['head', 'get', 'put', 'delete', 'post', 'patch'];
     });
     $router->head('/profiles/{item_name}', [new TestHandler(), 'processWithModel']);
     $router->delete('/profiles/{item_name}', [TestHandler::class, 'processWithModel']);
     $router->get('/profiles/{item_name}', [new TestHandler(), 'process']);
     $router->put('/profiles/{item_name}', [TestHandler::class, 'process']);
     $router->post('/profiles', [TestHandler::class])->param_sources('item_name', 'post');
     $router->patch('/profiles', [new TestHandler()])->param_sources('item_name', 'post');
     return $router;
 }