How to make multiple calls to class methods in the same line?

Viewed 9603

I have an issue in PHP. In my php file, i created the following line:

$foo = $wke->template->notify()
                     ->type("ERROR")
                     ->errno("0x14")
                     ->msg("You are not logged.")
                     ->page("login.tpl");

In the end, I need my $foo variable will return this:

$foo->type = "ERROR" 
$foo->errno= "0x14" 
$foo->msg= "You are not logged." 
$foo->page= "login.tpl"

Please note that the $wke->template is where i need call the notify() element.

2 Answers
Related