I'm trying to use classes rather than a function oriented approach but
obviously still learning. I pulled out the the not needed for this
example code:

 

 

 

 

class UpdateLastMaint {

            

            var $myKey = 0;

            var $action = "Add";

            

            

            function UpdateLastMaint($key,$action){

                $this->$myKey =$key;

               $this->$action=$action;

               echo "init action:".$this->$action;

         }

                       

         function GetAfter($key,$user_name) {  

              echo "action is :".$this->$action

          }          

                                    

}

 

Here I call the class

 

$LastMaintInfo=new UpdateLastMaint($item_id,"update");

$LastMaintInfo->GetAfter($item_id,$user_name);

 

The output on the screen is :

 

init action:update


action is :Array 

 

as you can see when I try to reference $this->action I am getting the
words Array. 

 

 

What am I doing wrong to not  be able to access the value of $action
when I use it in a function within the class?

 

Pat Newberry

www.gypsyfarm.com



[Non-text portions of this message have been removed]

Reply via email to