Posted by Gale on 10/10/38 11:23
Hale wrote:
> Hi,
>
> I have a dilemma I'm hoping you can help w/.
>
> I have a class where I'm passing a variable into the ctor of the base class
> and I want to use that value in a derived class in a function like below.
> The problem is, in the function something(), $this->param is NULL. How can
> I get this working correctly?
>
> Thanks.
>
> -----------------------------------
>
> class class1
> {
> public $param;
> function __construct($variable)
> {
> $this->param = $variable;
> }
> }
>
> class class2 extends class1
> {
> funcion something()
> {
> print $this->param;
> }
> }
>
>
try with scope ::
Navigation:
[Reply to this message]
|