控制器名称包含两个以上大写字母,在 codeigniter 中不起作用
我已经使用 codeigniter 构建了应用程序,
我的控制器名称是userReg
,在控制器中我声明了这样的类,
class UserReg extends CI_Controller { }
当我链接我使用的这个控制器时,注册
它在本地主机中工作正常,但是当我上线时,它生成页面未找到错误,
我也尝试过注册
,但不起作用。
那么有什么解决办法吗?
i have built application using codeigniter,
my controller name is userReg
, in controller i declared class like this,
class UserReg extends CI_Controller { }
when i link this controller i used, <a href="<?php echo base_url();?>userReg">Register</a>
it works fine in localhost, but when i put online, it's generate page not found error,
i have tried also <a href="<?php echo base_url();?>userreg">Register</a>
, but doesn't work.
so is there any solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据样式指南,您不应该使用驼峰命名法:
http://codeigniter .com/user_guide/general/styleguide.html#class_and_method_naming
According to the style guide, you shouldn't use CamelCase by the way:
http://codeigniter.com/user_guide/general/styleguide.html#class_and_method_naming
您的开发机器可能是 Windows,它具有不区分大小写的文件系统,并且您部署在区分大小写的 *nix 系统上。
首先要检查的是确保控制器的文件名都是小写的。这可能会解决。
我发现的最佳实践是将类全部小写并使用 _ 来分隔单词。
Your development machine is probably windows which has a case insestive file system and you deployed on a case sensitive *nix system.
The first thing to check is make sue the file names of the controllers are all lowercase. That might solve.
Best practice i found is to have classes all lower cased and use _ to separate words.