URL格式

ThinkCMF5采用的是混合模式路由,也就是说同时支持路由和PATH_INFO方式;

如果没有设置路由规则,默认就采用PATH_INFO方式,URL 格式如下:

http://yourServerName/index.php/应用/控制器/操作/[参数名/参数值...]

URL大小写

ThinkCMF5的 URL 是不区分大小写的,如:

http://localhost/index.php/portal/Demo/index
// 和下面的是等效的
http://localhost/index.php/portal/demo/index

访问驼峰法的控制器

访问下面的 url,其实访问的是 portal 应用下的 DemoTest控制器
http://localhost/index.php/portal/demo_test/index

访问下面的 url,其实访问的是 portal 应用下的 DemoTest控制器的 indexTest 方法
http://localhost/index.php/portal/demo_test/indextest

驼峰命名的控制器视图层目录名采用小写+下划线形式,如 DemoTest控制器它的视图层目录为 demo_test

驼峰命名的控制器方法,它的视图层文件全部采用小写形式,不加下划线,如 DemoTest控制器的indexTest 方法,它的视图文件名为 indextest+模板后缀名

隐藏入口文件

可以通过 url 重写方法隐藏 url 中的入口文件,ThinkCMF5默认自带了 apache 的 rewrite 规则文件,如果你是 apache 服务器,你只要开启项目的 rewrite 支持就可以了

results matching ""

    No results matching ""