我的路线结构是:
$route['404_override'] = 'home/check_path';我的home.php check_path()方法是:
public function check_path() {
$slug = $this->uri_segment(1); //<- This is line 68
//check if event exists
$event_check = $this->event_model->get_event_id_from_slug($slug);
if($event_check) {
redirect('events/view/'.$slug);
}else{
redirect('home/not_found');
}
}但是,当我编写http://mypage.com/anything-here时,会显示错误:
Fatal error: Call to undefined method Home::uri_segment() in /var/www/html/99fest/application/controllers/home.php on line 68发布于 2015-06-29 05:27:32
改变这一点:
$slug = $this->uri_segment(1); 通过以下方式:
$slug = $this->uri->segment(1)参见:http://www.codeigniter.com/userguide3/libraries/uri.html
https://stackoverflow.com/questions/31108296
复制相似问题