Patch #2812

Paginator view with limited number of links

Added by Alexey Khrulev over 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:04/20/2010
Priority:NormalDue date:
Assignee:Geert De Deckere% Done:

0%

Category:Modules:PaginationEstimated time:1.00 hour
Target version:v3.0.7
Resolution:fixed Points:

Description

"Basic" paginator view generates 1 link per each page, so number of links can be too big (in case of hundreds+ of pages). This problem is fixed in proposed code of paginator view. It provides set of links like this:

First Previous · 1 2 3 ... 22 23 24 25 26 [27] 28 29 30 31 32 ... 48 49 50 · Next Last

basic.php Magnifier (2.38 KB) Alexey Khrulev, 04/20/2010 11:17 PM

History

#1 Updated by Woody Gilk over 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Geert De Deckere

#2 Updated by Woody Gilk over 4 years ago

  • Target version changed from v3.0.5 to v3.0.6

#3 Updated by Woody Gilk about 4 years ago

  • Target version changed from v3.0.6 to v3.0.7

#4 Updated by Geert De Deckere about 4 years ago

  • Status changed from Assigned to Closed
  • Resolution set to fixed

Thanks, Alexey. I added your view as a separate view called "floating". Besides some coding style changes, I also made $count_in and $count_out configurable.

echo Pagination::factory(array(
    'view'      => 'pagination/floating',
    'count_out' => 2,
    'count_in'  => 4,
    // more settings...
));

http://github.com/kohana/pagination/commit/1eb89095a9d72a76c3d957308ab4dbddfb32b6f9

Also available in: Atom PDF