【发布时间】:2014-07-31 05:32:38
【问题描述】:
我在我的服务器上上传了 CodeIgniter,基本页面运行良好。 然后我在 application/controllers 文件夹中添加了带有 Hello 类和函数一的 home.php 文件,并尝试打开链接 url/index.php/Hello/one 但我得到了找不到页面的 codeIgniter 错误。我会错过什么?
【问题讨论】:
标签: codeigniter
我在我的服务器上上传了 CodeIgniter,基本页面运行良好。 然后我在 application/controllers 文件夹中添加了带有 Hello 类和函数一的 home.php 文件,并尝试打开链接 url/index.php/Hello/one 但我得到了找不到页面的 codeIgniter 错误。我会错过什么?
【问题讨论】:
标签: codeigniter
要解决您的问题,您应该将 Hello 类重命名为 Home,然后转到 URL/index.php/home/one
我建议您阅读控制器文档:
http://ellislab.com/codeigniter/user-guide/general/controllers.html
控制器只是一个类文件,其命名方式可以 与 URI 关联。
考虑这个 URI:example.com/index.php/blog/
在上面的例子中,CodeIgniter 会尝试寻找一个控制器 命名为 blog.php 并加载它。
当控制器的名称与 URI 的第一段匹配时,它将 被加载。
【讨论】: