Welcome Guest, Not a member yet? Register   Sign In
URI Segments only grabbing first number
#2

[eluser]WanWizard[/eluser]
You are making it a lot more complicated then needed.

With a URL like http://localhost/index.php/site/record/39, CI will take care of the routing to controller site, method record().

You then define the method:
Code:
function record( $id = FALSE )
{
    if ( $id )
    {
        $this->load->model('client_details_model');
        $data['records'] = $this->client_details_model->getClientDetails($id);
        // you probably want to check the resultset first before loading the view?
        $this->load->view('client', $data);
    }
    else
    {
        // no id passed, redirect to the index
        redirect('site/index');
    }
}


Messages In This Thread
URI Segments only grabbing first number - by El Forum - 09-15-2010, 05:10 AM
URI Segments only grabbing first number - by El Forum - 09-15-2010, 06:08 AM
URI Segments only grabbing first number - by El Forum - 09-15-2010, 07:24 AM
URI Segments only grabbing first number - by El Forum - 09-15-2010, 07:53 AM
URI Segments only grabbing first number - by El Forum - 09-15-2010, 08:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB