Jump to content

Model In Controller


tobeyt23

Recommended Posts

I am using cakephp have a controller users inside of that I am using the model companies. All loads and looks great, but when I try and do an ajax post to save the company info I get page not found, but when I do an ajax call to user all works fine. Has this happened to anyone else?

 

function user() {
        $this->autoRender = false;

        if($this->RequestHandler->isAjax()) {
            if ($this->data) {
                  $this->User->create();
                        if ($this->User->save($this->data)) {
                   }
            }
        }
    }

function company() {
        $this->autoRender = false;

        if($this->RequestHandler->isAjax()) {
            if ($this->data) {
                $this->Companies->save($this->data);
            }
        }
    }

Link to comment
https://forums.phpfreaks.com/topic/221622-model-in-controller/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.