Query string pagination with codeigniter

1

How can I do paging with query string in CodeIgniter? I'm trying to search the documentation but I have not found it! I have the following scenario:

http://localhost/meusite/procurar/s?search_state=RJ&search_city=Rio+de+Janeiro

If it was a page without a search it would be easy, just indicate the main page that will appear the listing, but as a search system how do I do when I click the next page keep the search criteria in the get?

    
asked by anonymous 08.05.2018 / 18:09

1 answer

1

RESOLVED AS FOLLOWS:

As the problem was to identify the paging number, then I did it that way, I do not know if it's the best one, but it worked for me:

     $state   = $this->input->get('search_state');
     $city    = $this->input->get('search_city');

     $urlExp  =  explode("=", $_SERVER['QUERY_STRING'] );

     $maximum                   = 1;
     $start                     = isset( $urlExp[3] ) ? $urlExp[3] : 0;

     $config['base_url']        = base_url( 'procurar/result?search_state=' .$state. '&search_city=' .$city. '' );
    
08.05.2018 / 20:09