Welcome Guest, Not a member yet? Register   Sign In
Pagination when $config['per_page'] = 1
#5

[eluser]osci[/eluser]
$Cesar
1)
Are you troubled with what offset is? You shouldn't do this kind of fix, which is a try ti mix page number and offset.
If you want your pager to have page number and not offset you have to change it to always deliver page numbers instead of offset, which you would have to calculate in your controller maybe to be turned into an offset and so be used in a query.

2)
When you want to extend a core class/lib etc you use MY_ prefix or whatever you have set, and since you want a new kind of pager you would create a new function create_number_links() for example.

Your solution is totally wrong approach. And it's not correct either
Code:
if($this->per_page == 1)
{
    $this->cur_page = floor(($this->cur_page/$this->per_page));
}
else
{
    $this->cur_page = floor(($this->cur_page/$this->per_page) + 1);
}
How do you handle the offset for the db call?


Messages In This Thread
Pagination when $config['per_page'] = 1 - by El Forum - 06-25-2011, 02:50 PM
Pagination when $config['per_page'] = 1 - by El Forum - 06-26-2011, 12:53 PM
Pagination when $config['per_page'] = 1 - by El Forum - 06-26-2011, 01:36 PM
Pagination when $config['per_page'] = 1 - by El Forum - 06-27-2011, 10:21 AM
Pagination when $config['per_page'] = 1 - by El Forum - 06-27-2011, 02:08 PM
Pagination when $config['per_page'] = 1 - by El Forum - 06-27-2011, 04:26 PM
Pagination when $config['per_page'] = 1 - by El Forum - 06-27-2011, 10:11 PM
Pagination when $config['per_page'] = 1 - by El Forum - 06-28-2011, 05:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB