比如
$app->get('/hello/:name', function ($name) {
    echo "Hello, $name";
});
$app->post('/hello/:name', function ($name) {
    echo "Hello, $name";
});
相比传统的 class xxController {
function xxxAction($name){
    echo "hello".$name
  }
}
有什么好处吗?
|  |      1ywisax      2015-07-01 16:15:27 +08:00 可以提高灵活度。 如果不想这样折腾,那就用map(.........)->via('GET', 'POST')来做吧 |