I have a page which normally displays 10 items per page and shows the page numbers at the bottom of the page as below:
<prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 next>
where each of the above is a page number and each page displays 10 items in turn.
There is a search option on this page which can be used to search the items by 'keywords' or 'categories'. When the search is done say, with a keyword 'sports', it displays the correct number of items but the page numbers at the bottom of the page displays the whole menu rather than showing,
<prev 1 2 next>
if there are under 20 items corresponding to that item search.
You are right, below is the code that is doing it in php. We use a software called PRADO. The code looks correct to me but displays all the page numbers at the bottom rather than 2 pages for an item count between 10-20.
The only thing I can think of is this: when it doesn't get a result set larger than 10, it must default to something else. I mean, if you have 10 results and 10 results per page, you still have 1 page. I am not sure if you have to set this, either way, or not.
I'd suggest trying to set the page count, no matter what. I would think the pager should take care of dealing with showing it or not. If that doesn't work, I am out of suggestions. You may want to hop on the PRADO forum and see if they have any suggestions. Wish I could be of more help. ......but try setting the page count no matter how many results there are....if there's one page...set it to one....