Thankyou Nilaab and Hatem for the replies.
I can see that extending classes is probably the way to go. I was kind of
aware of how it works, but didn't see it as an obvious solution. But looking
at it more closely, I think I should be able to put most common stuff in a
basic class. Different kin
If these two classes are in separate files then you will need to include one
of the classes in with the other class using the include() or require()
functions. Have you also used the extends keyword to extend the main class?
When you use inheritance properties, you can use the $this-> mechanism
wit
Assuming you have
class WebPage {
var $property1;
function get_property1()
{
return $this->$property1;
}
}
class Sample extends WebPage{
}
To access $property1 from your WebPage class just do
$page = new Sample;
$prop1 = $page->get_property1();
Otherwise try to send a snip
3 matches
Mail list logo