Welcome Guest, Not a member yet? Register   Sign In
Pagination and GET
#1

[eluser]Raymondddd[/eluser]
Hi,

For the category product overview i use the pagination class. I'm now working on a filter system to filter products in a category on i.e. product type of prices, based on GET values.

The problem is, when i have the url site.com/category?type=1 and use the pagination, he will send me to site.com/category/page/20. So; he drops the GET values.

Someone experience with this? What is the best way to handle pagination with GET values? Do i have to change the core of the pagination class?

Look forward to your response!

Raymond
#2

[eluser]memVN[/eluser]
Ok, I think you can use this code
[/code]This Library Pagination

Code:
// Config to pagination, you must add tow line
$config['page_query_string'] = TRUE;
$config['query_string_segment'] = 'page';

Ok, now your url will become ==> http://yourdomain.com/category/?type=1&page=20.
Now, you can get value of type and page by call
[code]
$type = this->input->get('type');
$page = $this->input->get('page');
#3

[eluser]Raymondddd[/eluser]
Aah i see. Looks better, but i see the ?page=20 element 3 times like:

site.com/category/&page;=&page;=&page=30
#4

[eluser]memVN[/eluser]
You can give me view your code (full code), I think you config wrong




Theme © iAndrew 2016 - Forum software by © MyBB