cakephp controller using functions from another controller

0

Good evening! I have 2 client and email tables , when saving the client I need to save the email next to the email table, however I need to call the "save" function of the email controller. how do I do? Thank you all

    
asked by anonymous 25.10.2017 / 03:33

1 answer

0

To use a model from another controller, you can do the following:

public function add() {
    ...
    Controller::loadModel('EmailModel');
    $this->EmailModel->save(...);
}
    
25.10.2017 / 04:47