1

My routes structure is :

$route['404_override']          = 'home/check_path';

And my home.php check_path() method is :

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');
        }
    }

But when I write http://mypage.com/anything-here is shows error:

Fatal error: Call to undefined method Home::uri_segment() in /var/www/html/99fest/application/controllers/home.php on line 68
2
  • $slug = $this->uri->segment(2); check now Commented Jun 29, 2015 at 5:24
  • Same error I am getting Commented Jun 29, 2015 at 5:26

1 Answer 1

1

Change this:

$slug = $this->uri_segment(1); 

With:

$slug = $this->uri->segment(1)

See this: http://www.codeigniter.com/userguide3/libraries/uri.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.