基础路由
语法:Route::rule('路由表达式', '路由地址', '请求类型');
例如:
Route::rule('new/:id','News/read');
//访问
http://serverName/new/5
//会自动路由到
http://serverName/news/read/id/5
指定类型的路由(GET/POST/PUT/DELETE/PATCH/*)
Route::rule('new/:id', 'News/update', 'POST');
Route::rule('new/:id','News/read','GET|POST');
语法: Route::快捷方法名('路由表达式', '路由地址');
Route::get('new/<id>','News/read'); // 定义GET请求路由规则
Route::post('new/<id>','News/update'); // 定义POST请求路由规则
Route::put('new/:id','News/update'); // 定义PUT请求路由规则
Route::delete('new/:id