CakePHP: calling other Model functions

前端 未结 7 692
感动是毒
感动是毒 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:13

    User App::import()

    App::import('Model','OtherModel');
    $attr = new OtherModel();
    $attr->Othermodelfunction();
    

提交回复
热议问题