Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
To make a "cascade" of successive methods, you need to return the same object in each method.
class Base {
public function test($string){
// Что то делаем.
return $this;
}
public function chek($string){
// Что то делаем.
return $this;
}
public function hello(){
// Что то делаем.
return $this;
}
}
$base
->test('string1')
->chek('string')
->hello();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question