https://hyperf.wiki/2.2/#/zh-cn/quick-start/overview
Router::get('/hello','App\Controller\hello\HelloController@hello');
Router::get('/hellotest','App\Controller\hello\HelloController@test');
// 此处代码示例为每个示例都提供了三种不同的绑定定义方式,实际配置时仅可采用一种且仅定义一次相同的路由
// 设置一个 GET 请求的路由,绑定访问地址 '/get' 到 App\Controller\IndexController 的 get 方法
Router::get('/get', 'App\Controller\IndexController::get');
Router::get('/get', 'App\Controller\IndexController@get');
Router::get('/get', [\App\Controller\IndexController::class, 'get']);
// 设置一个 POST 请求的路由,绑定访问地址 '/post' 到 App\Controller\IndexController 的 post 方法
Router::post('/post', 'App\Controller\IndexController::post');
Router::post('/post', 'App\Controller\IndexController@post');
Router::post('/post', [\App\Controller\IndexController::class, 'post']);
// 设置一个允许 GET、POST 和 HEAD 请求的路由,绑定访问地址 '/multi' 到 App\Controller\IndexController 的 multi 方法
Router::addRoute(['GET', 'POST', 'HEAD'], '/multi', 'App\Controller\IndexController::multi');
Router::addRoute(['GET', 'POST', 'HEAD'], '/multi', 'App\Controller\IndexController@multi');
Router::addRoute(['GET', 'POST', 'HEAD'], '/multi', [\App\Controller\IndexController::class, 'multi']);
//demo路由表
Router::addGroup('/demo/',function (){
Router::get('index','App\Controller\Demo\MainController@index');
// Router::get('gett/','App\Controller\Demo\MainController@gett');
// Router::post('post','App\Controller\Demo\MainController@post');
// Router::put('put','App\Controller\Demo\MainController@put');
// Router::head('head','App\Controller\Demo\MainController@head');
// Router::delete('delete','App\Controller\Demo\MainController@delete');
// Router::patch('patch','App\Controller\Demo\MainController@patch');
// Router::addRoute(['GET','POST'],'dbindex','App\Controller\Demo\DbtestController@index');
});