> if ($this->params['named']['sort'] === 'RAND()') { // or any sting you
> choose
> $this->pagainte['sort'] = 'RAND()';
> }
>
> But unless you've got only 1 page of results I doubt that's really
> what you want (hint - click sort*, click page 2, click page 1*. * they
> won't be the same and more importantly there will be results you may
> be unable to find or find repeatedly - on page 1, page 2, page 3 etc.)
Yep - each page would be different, rather than the whole set
randomised. A better bet would be to randomly sort a list of ids for
the entire table, then custom paginate that.
You could store this random array of ids in the session, or perhaps
cache the list of ids with a random string which is appended to the
url.
Otherwise, don't paginate and you'll be fine.
hth
J
--
jon bennett - www.jben.net - blog.jben.net
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
To unsubscribe from this group, send email to
cake-php+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.