[drupal-devel] Question on use of theme_pager() and related functions

Axel Kollmorgen axel at kollmorgen.net
Tue May 3 16:41:30 UTC 2005


Scott Courtney wrote:
> Is there a good example somewhere illustrating the correct use of calls to
> theme('pager',....)?
> 
> I'm trying to use this function, and I've actually got it working except for
> one issue: I don't know how to tell it the actual number of rows that were
> returned from my database query.

what do you need that "actual number of rows that were returned from my 
database query" for? the meaning of theme_pager() is to split an 
resultset of x rows into pages of $limit rows.

if you really really need the total number of rows, check

   global $pager_total;

init'ed in pager_query(), used in theme_pager().

> I see the "tags" array that can be passed, and it *looks* as if that would
> be the right thing to do.

no - the $tags param is used change the pager strings 'first page', 
'previous page', 'next page', and 'last page'.

-- 
ax

I'm tired, Trinity. I tired of this war. I'm tired of fighting. I'm 
tired of this ship, of being cold, eating the same God-damn goop 
everyday. But most of all, I'm tired of that jack-off and all of his 
bullshit. Surprise ass-hole. I bet you never saw this coming, did you? 
God, I wish I could be there, when they break ya. I wish I could walk in 
just when it happens. So right then, you'd know it was me. - Cypher, The 
Matrix




More information about the drupal-devel mailing list