04-18-2009, 07:33 AM
|
#12 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
|
Quote:
Originally Posted by allworknoplay
Tanax, question about a piece of your code.....
What does it mean when you say "return false",
and you also say "return true", but what are you actually
returning?
Code:
public function checkLink($pagenr) {
if($pagenr <= $this->totalPages && $pagenr >= 1) {
return true;
}
return false;
}
Thanks!!
|
It validates the page number and return a boolean value to check if the page number is valid:
PHP Code:
/* ... */
if($pagination->checkLink(1337))
{
echo 'Amazingly enough, 1337 is a valid page number';
}
__________________
|
|
|