04-18-2009, 02:03 PM
|
#7 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by Tanax
One thing to keep in mind though, is that every classvariable ($this->classvariable) should be declared in the beginning of the class.
Like such:
PHP Code:
class Pagination {
private $classvariable1;
private $classvariable2;
private $classvariable3;
// in your methods you can then access them like normal: $this->classvariable1 or 2 or 3 respectivly.
}
Note that you can use whichever scope you want right now, but I would strongly advice you not to use public classvariables.
Also note that it will work even if you don't declare them, however the PHP will work faster if you declare them, so just an advice.
|
Yes I am declaring all my properties to "private". I hope I can show you my class later today, it is almost done.
I think writing a pagination class script is a good way to learn OO. Much better than doing a "hello world" in OO....
|
|
|
|