Php basic question a (aa)-& gt; B (bb)-& gt; c (cc); what does this mean? It is not too troublesome. can you give an example to illustrate it? I don't know much about this. here is more about basic php questions.
A ('A')-> B ('BB ')-> c ('CC ');
What does this mean?
It is not too troublesome. can you give an example to illustrate it?
Not familiar with this
Share: More
------ Solution --------------------
Obtain an object in function a, and then call Method B of this object. Method B returns an object, and then calls its c method through this object.
------ Solution --------------------
a()->b()->c();
function a() {
$r = new obj1;
return $r;
}
class obj1{
public function b(){
$r=new obj2;return $r
}
}
class obj2{
public function c(){
//do something
}
}
------ Solution --------------------
class T {
function b($v) {
echo $v;
return $this;
}
function c($v) {
echo $v;
return $this;
}
}
function a($v) {
echo $v;
return new T;
}
a('aa')->b('bb')->c('cc');
------ Solution --------------------
Reference:
A ('A')-> B ('BB ')-> c ('CC ');
What does this mean?
It is not too troublesome. can you give an example to illustrate it?
Not familiar with this
A () independent method returns an object of an instantiated class. this class contains function B. function B returns the object of another class and contains function c.