关于5.0版本中不再支持普通URL模式的说明

在5.0版本中,普通URL模式的解析已被取消,类似于http://tp5.com/?m=module&c=controller&a=action的方式将不再有效。新版支持一种强制路由模式,类似于Laravel路由。开启强制路由模式后,必须为每个访问地址定义路由规则,包括首页,否则系统会抛出异常。启用强制路由模式需要修改配置:'url_route_on' => true 和 'url_route_must' => true。开启此模式后,首页路由规则需用/定义,如:Route::get('/','index/Index/index')。除了首页,其他路由规则不需以/开头或结尾,系统会自动去掉。以下示例展示了等效的路由规则:Route::get('hello/:name','index/Index/hello'); 与 Route::get('/hello/:name','index/Index/hello') 和 Route::get('hello/:name/','index/Index/hello')。
pdf 文件大小:1.03MB