pagination_links not generating correct href

24 views
Skip to first unread message

Ethan Gruber

unread,
Oct 29, 2009, 11:22:29 AM10/29/09
to omek...@googlegroups.com
Hi,

I am working on a SolrSearch plugin and am using the same method as LuceneSearch for paging through the results.  In my controller, I have:

$pagination = array( 'page'          => $page,
                             'per_page'      => $limit,
                             'total_results' => $numFound);
Zend_Registry::set('pagination', $pagination);

---

In my view, I am calling pagination_links().  The list of pages appear correctly, but the href attribute itself does not point to the correct page number.  For example, if I am on page 4 (by putting ?page=4 into the url), pagination_links properly displays "first previous 2 3 4 5 6 next last", but the href for each link actually points to the current page.

Am I missing something?  Why would the pagination div display the correct numbers, but not the correct url?

Thanks,
Ethan Gruber
University of Virginia Library

Kris Kelly

unread,
Oct 29, 2009, 7:53:05 PM10/29/09
to omek...@googlegroups.com
My guess is that the route you are using doesn't have a 'page'
parameter in it. You can work around this by adding that parameter to
whatever route is being used for that action, or you can use the
default route. This is because the links in the pagination are all
constructed based on the current route. Let us know if that helps.

Kris
Reply all
Reply to author
Forward
0 new messages