Welcome Guest, Not a member yet? Register   Sign In
Title after the id in the url gives 404
#6

[eluser]theprodigy[/eluser]
Quote:
Code:
class Blog extends CI_Controller {

    function index() {
       $this->load->model('blog_model');
       $this->load->helper('url');
       $this->load->helper('text');
       $data['rows'] = $this->blog_model->showBlogs();
       $this->load->view('blogs/blog_view', $data);
    }
    
    function view() {
        $this->load->model('blog_model');
        $data['rows'] = $this->blog_model->showSingleblog();
        $this->load->view('blogs/blog_singleview', $data);
    }
}

Have you tried adding a parameter to the view function (and pass it to the model) rather than trying to use url segments?
Code:
class Blog extends CI_Controller {

    function index() {
       $this->load->model('blog_model');
       $this->load->helper('url');
       $this->load->helper('text');
       $data['rows'] = $this->blog_model->showBlogs();
       $this->load->view('blogs/blog_view', $data);
    }
    
    function view($blog_id) {
        $this->load->model('blog_model');
        $data['rows'] = $this->blog_model->showSingleblog($blog_id);
        $this->load->view('blogs/blog_singleview', $data);
    }
}


Messages In This Thread
Title after the id in the url gives 404 - by El Forum - 05-22-2011, 07:35 AM
Title after the id in the url gives 404 - by El Forum - 05-22-2011, 10:12 AM
Title after the id in the url gives 404 - by El Forum - 05-22-2011, 10:24 AM
Title after the id in the url gives 404 - by El Forum - 05-22-2011, 11:02 AM
Title after the id in the url gives 404 - by El Forum - 05-22-2011, 01:02 PM
Title after the id in the url gives 404 - by El Forum - 05-22-2011, 01:13 PM
Title after the id in the url gives 404 - by El Forum - 05-22-2011, 02:05 PM
Title after the id in the url gives 404 - by El Forum - 05-22-2011, 02:09 PM
Title after the id in the url gives 404 - by El Forum - 05-23-2011, 06:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB