views:

40

answers:

1

Is it possible to append query strings to the links created by the pagination class?

Currently if you are on this page:

http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes?price_low=19&price_high=300

the links are incorrectly generated as

http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes&per_page=20
http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes&per_page=40
etc.

where it should be:

http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes?price_low=19&price_high=300&per_page=20
http://127.0.0.1/~panayi/xryses/Nicosia/browse/Homes?price_low=19&price_high=300&per_page=40
etc.

I have tried to pass

$config['base_url'] = current_url();

to the Pagination class, but that doesn't work.


Update: I gave up on this and following a post on CI forums, I have build an intermediate controller that takes the $_POST array and builds a query string

$query = 'type:apartment,house&price_low:15000&price_high:60000';

Then redirects to the Browse controller

http://127.0.0.1/~panayi/xryses/Nicosia/browse/type:apartment,house&price_low:15000&price_high:60000

and paginated views:

http://127.0.0.1/~panayi/xryses/Nicosia/browse/type:apartment,house&price_low:15000&price_high:60000/20
http://127.0.0.1/~panayi/xryses/Nicosia/browse/type:apartment,house&price_low:15000&price_high:60000/40
etc.
+1  A: 

You will need to customize the Pagination library of Codeigniter to do this.

ShiVik