Click to See Complete Forum and Search --> : Variables and classes


manyamile
07-21-2007, 07:47 AM
Hi,

I define a base class with a parameter to it.

$param=....

include "baseclass.class.php";
$inst = new baseclass($param);

and in baseclass:

var $paramm=0

function baseclass($param)
$this->paramm=$param
}

also in baseclass:

function work1(){

..use $this->paramm in here

}

If I call work1() from anywhere else but the constructor of the base class,
the value of $this->paramm is zero.

How can I make the new value of $this->paramm be visible in the base class and all extended classes?

Thanks.