View Single Post
Old 04-18-2009, 07:33 AM   #12 (permalink)
Kalle
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Quote:
Originally Posted by allworknoplay View Post
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';

__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote