Re: Pager question - can you configure it to page-link alphabetically by last name?

From: Date: Wed, 30 Nov 2005 08:44:52 +0000
Subject: Re: Pager question - can you configure it to page-link alphabetically by last name?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22104@lists.php.net to get a copy of this message
l Burnerheimerton wrote:
For example, give an initial list then the links would be like: A B C D E ... When you clicked on "A", it displayed the first page of people with the last name starting with "A". Can this be done? If so, any examples?
Well, I just did it yesterday :-) Unfortunately, the page is not yet online, so I can't show you. Anyway, it's not so related with Pager: I just built on myself the letter list and used the wrapper function provided in examples to get the paged data. You can build the list like this: <?php for ($i = ord('A'); $i <= ord('Z'); $i ++) {
    $c = chr($i);
    printf('<a href="yourpage.php?start=%1$s">%1$s</a>', $c);
    $output .= ' ';
} ?> -- Massimiliano Arione http://garakkio.altervista.org

« previous php.pear.general (#22104) next »