Welcome Guest, Not a member yet? Register   Sign In
A Case for _GET variables
#11

[eluser]Colin Williams[/eluser]
I'm not sure what makes generating query string links easier than segmented ones. In fact, all of CI's url functions expect segments, so I would think that would be the path of least resistance

Here's how I'd see the search function looking

Code:
function search()
{
    // Do search if there was a form submitted
    if (count($_POST))
    {
        $uri = '';
        $this->input->xss_clean($_POST);
        foreach($_POST as $key => $val)
        {
            $uri .= "$key/$val/";
        }
        redirect('browser/search/'. $uri);
    }
    
    // Do a search and load a view
    $this->load->model('vehicle');
    $data['result'] = $this->vehicle->get($this->uri->uri_to_assoc());
    $this->load->view('auto_search', $data);
}

There is obviously some more logic to it, but the basic idea is there


Messages In This Thread
A Case for _GET variables - by El Forum - 06-30-2009, 11:32 AM
A Case for _GET variables - by El Forum - 06-30-2009, 12:14 PM
A Case for _GET variables - by El Forum - 06-30-2009, 12:40 PM
A Case for _GET variables - by El Forum - 06-30-2009, 01:14 PM
A Case for _GET variables - by El Forum - 06-30-2009, 02:05 PM
A Case for _GET variables - by El Forum - 06-30-2009, 02:17 PM
A Case for _GET variables - by El Forum - 06-30-2009, 02:43 PM
A Case for _GET variables - by El Forum - 06-30-2009, 02:48 PM
A Case for _GET variables - by El Forum - 06-30-2009, 02:52 PM
A Case for _GET variables - by El Forum - 06-30-2009, 03:08 PM
A Case for _GET variables - by El Forum - 06-30-2009, 03:22 PM
A Case for _GET variables - by El Forum - 06-30-2009, 05:23 PM
A Case for _GET variables - by El Forum - 06-30-2009, 05:38 PM
A Case for _GET variables - by El Forum - 07-01-2009, 01:30 AM
A Case for _GET variables - by El Forum - 07-01-2009, 02:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB