Possible Duplicate:
PHP method chaining?
I had a function for create user, like cruser inside class and set password like setpw.
I want to create a validate function to check the username and password and I want use it like this:
$a = new class abc();
$a->cruser->chk();
$a->setpw->chk();
Need 2 different function or same can do? It's so elegant, how can I define this?
class abc {
function cruser { }
function setpw {}
//??? - need to define here chk or to different class?
}
for PHP 5.2/5.3.
How can I achieve this, or is there a better way?