Jump to content

Codeigniter write URL from controller


c_pattle

Recommended Posts

I have a function called "search" that handles a form submission.  When I submit the form the URL is "products/search/".  Is there a way to make the controller function output a different URL so instead it would be "products/search/searchCat/searchString" where searchCat and searchString are the two post values from the form? 

 

Below is my function

 

    function search()
    {
        $searchCat = $this->input->post('searchCat');
        $searchString = $this->input->post('searchString');
        $aData['query'] = $this->ProductModel->GetProductsBySearch($searchCat, $searchString);
       
        $aData['base_url'] = base_url();
        $aData['breadcrumbs'] = create_breadcrumb();
        
        $this->load->view('product_layout', $aData);
    }

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/251714-codeigniter-write-url-from-controller/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.