[Solar-talk] Pager helper changes
Rodrigo Moraes
rodrigo.moraes at gmail.com
Sat Jun 30 17:40:45 CDT 2007
2007/6/30, Jeff Surgeson:
> All I get is
> << Newest < Newer of Older > Oldest >>
>
> No page of pages numbers, what am I doing wrong, I assumed that the default
> config should work ok.
Hi, Jeff.
Sorry to not mention this, but you have to define a locale value using
sprintf placeholders. This should work for the count 'adapter':
'PAGER_PAGE_X-Y_OF_Z' => '%1$d-%2$d of %3$d',
Try to set it and let me know if it is ok. I'm using exactly the same
code which is in SVN, and the count adapter is working well, but maybe
I'm missing something.
Just to check,: is $this->pages in your example the number of pages?
If yes, it should be the number of *items* in *all* pages. The pager
now calculates the number of pages, so it is no longer a parameter.
And to be clear, these are all the locale keys used by the pager and
all adapters (and the definitions I use):
'PAGER_PAGE_QUERY' => 'page',
'PAGER_PREVIOUS_PAGE' => '<',
'PAGER_NEXT_PAGE' => '>',
'PAGER_FIRST_PAGE' => '<<',
'PAGER_LAST_PAGE' => '>>',
'PAGER_PAGE_X' => 'Page $d',
'PAGER_PAGE_X_OF_Y' => 'Page %1$d of %2$d',
'PAGER_PAGE_X-Y_OF_Z' => '%1$d-%2$d of %3$d',
'PAGER_NEWEST' => '<<',
'PAGER_NEWER' => '<',
'PAGER_OLDER' => '>',
'PAGER_OLDEST' => '>>',
The last 6 are the required ones by the 'count' adapter.
I've been thinking to make the locale keys configurable. I have two
uses for the 'count' adapter, and while in one I want to have
"Newest"/"Newer"/"Older"/etc, in other I want just arrows like defined
above. Nothing would change in a default usage, but it would be
possible to make the same adapter use different locale keys depending
on the needs ("newer/older" only fits well a chronological list). It's
no big deal and it would allow some more possibilities.
Let me know if it worked well and thanks for the feedback. :)
-- rodrigo
More information about the Solar-talk
mailing list