1

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.

1 Answer 1

3
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.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.