wyangu 发表于 2011-5-3 21:37:50

如何区分是文件夹还是控制器呢?

本帖最后由 wyangu 于 2011-5-3 22:04 编辑

rt
example.com/index.php/products/shoes/show/123

这个路径可以理解为products 文件夹下的shoes控制器 也可以理解为
products为控制器 shoes为方法 show和123为参数

如何区分呢?
ci优先原则会认为products为控制器。
如果现在情况是products为文件夹 shoes为控制器 show为方法 123为参数

如果出现这种情况怎么办
products为控制器 shoes方法 show和123为参数
现这种条件下是不是就要出现覆盖的情况

geomen 发表于 2011-5-4 10:38:33

默认的都是products为控制器 shoes为方法 吧,如果product为文件夹不是应该在index.php前面吗?

tiana 发表于 2011-5-4 20:08:01


$this->router->fetch_directory(); // 目录
$this->router->fetch_class(); // 控制器
$this->router->fetch_method(); // 动作

自己做一下判断就行了
页: [1]
查看完整版本: 如何区分是文件夹还是控制器呢?