CakePHP: calling other Model functions

前端 未结 7 691
感动是毒
感动是毒 2020-12-31 10:04

How can i call, from a Model, a function present in another model? I would like not to repeat code.

7条回答
  •  情深已故
    2020-12-31 10:08

    • if there's a (direct or indirect) relationship between the model, you can call the function: $this->Model1->Model2->...->Modeln->function();

    • use bindModel

提交回复
热议问题