Welcome Guest, Not a member yet? Register   Sign In
Question with isset on a search function?
#3

[eluser]Phil Sturgeon[/eluser]
Code:
function search($term = '', $list_style = 'grid')
{

$this->load->view('template/header');

// Get the search term from the submitted form if none provided in URL    
if($term == '') $term = $this->input->post('term');
                
$data['query'] = $this->product_model->search_keyword($term);

if($list_style == "grid"){
    $this->load->view('pages/phones_grid', $data);
}
else
{
    $this->load->view('pages/phones_list', $data);
}

//$this->load->view('template/footer');
}

That will allow search terms to be either uri segment 4 or post, and the list type is optional for uri segment 5, defaulting to 'grid'.


Messages In This Thread
Question with isset on a search function? - by El Forum - 01-14-2009, 04:36 PM
Question with isset on a search function? - by El Forum - 01-14-2009, 06:07 PM
Question with isset on a search function? - by El Forum - 01-15-2009, 05:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB