A,r,m,d method Difference of thinkphp
In thinkphp, there are several ways to instantiate an object, if it is a class, there is a and R methods, the difference is that the A method is only an instantiation of the object, and the R method can be instantiated at the same time the method inside the object, where you need to specify, such as the following instance code:
Test1 (); echo "";//You can also go across modules call $test_m=a ("Home/goods"), Echo $test _m->test (); echo "",//r method can take execution of the corresponding module R ("Home/goods /test ");//$this->display ();}}
As can be seen from the above, the R method can also be used to cross-module to instantiate.
In addition, in model data models, it is necessary to use the following two methods, one is the D method, one is the M method, the former is the instantiation of the data model class, and the latter is the parent class of the instantiated data model.
Select (); echo "
"; Var_dump ($mythinkphp->select ()); echo count ($t); echo ""; echo Count ($t [1]); echo ""; for ($i =0; $i
Although there is no difference from usage, the D method instantiates only the defined data model class, and the M method instantiates the parent class of the data model.
http://www.bkjia.com/PHPjc/992669.html www.bkjia.com true http://www.bkjia.com/PHPjc/992669.html techarticle thinkphp The A,r,m,d method differs in thinkphp, there are several ways to instantiate an object, if it is a class, there is a and R methods, the difference is that a method is just an instantiation of the object, and the R method is available ...