【发布时间】:2012-12-31 08:47:59
【问题描述】:
我是 Codeigniter 的新手。在尝试访问控制器特定方法时,我收到“Object Not found”异常。
在点击网址之前,我做了以下更改:
- base_url 在config.php 中设置为
http://localhost/test/ - default_controller 设置为
main - main.php类中定义的索引和登录方法
如果我尝试只点击http://localhost/test/,它会从 index 方法返回 echo。但是如果我直接给http://localhost/test/main/login 那么它会抛出Object not found 异常。
奇怪的是,如果我将$this->login(); 赋予主控制器类的索引方法,http://localhost/test/会命中登录方法。我试图将登录方法更改为public,但没有运气。
我在这里缺少什么?
【问题讨论】:
标签: php codeigniter