tags:

views:

27

answers:

1

Hello, i have a class like:

class List_PendingVerify extends Rs_List {

 public function __construct( $id ) {
           }

    protected function loadData( ) {
           }
}

Now i how could i get value of $id in loadData function ?

so that i can be able to echo $id.

Thanks.

+3  A: 
class List_PendingVerify extends Rs_List {
    public function __construct($id) {
        $this->id = $id;
    }

    protected function loadData() {
        echo $this->id;
    }
}

I recommend reading the Classes and Objects documentation. (In particular, the Properties section is relevant here.)

Ben James