}
2、在route/route.php或者applicationroute.php添加路由规则,如下:
'index/hello', ]; 3、定义路由的请求类型和后缀 return [ // 定义路由的请求类型和后缀 'hello/[:name]' => ['index/hello', ['method' => 'get', 'ext' => 'do']], ]; 定义后缀后,必须添加后缀才能访问,如下:  ### 三、添加路由别名 方式一: 动态方法:Route::alias('规则名称','模块/控制器',[路由参数]); Route::alias('index','index/Index'); Route::alias('login','index/Login'); Route::alias('main','index/Main'); /*-------------------------------------------- 方式二: 动态数组:return[ '__alias__'=>['规则名称','模块/控制器',[路由参数]] ]; return [ //路由别名 '__alias__' => [ 'index' => 'index/Index', 'login'=> 'index/Login', 'main'=> 'index/Main', ], ]; ### 四、添加路由分组 1、在**application\index\controller\Index.php**添加如下几个方法,如下: **本文已被[CODING开源项目:《Android学习笔记总结+移动架构视频+大厂面试真题+项目实战源码》](https://docs.qq.com/doc/DSkNLaERkbnFoS0ZF)收录**


