I don't know how to do this:
I have a CakePHP project that uses AdministratorsController
and UsersController
for different roles, etc.. but, a User can save a Message and a Administrator too! So, should I repeat the same function or what?
function saveMessage(){
$this->autoRender = false;
if (!$this->RequestHandler->isPost())
$this->Session->setFlash('Error 78.', 'flash_custom_danger');
else{
if(!$this->Message->save($this->request->data))
$this->Session->setFlash('Error 985.', 'flash_custom_success');
else
$this->Session->setFlash('Success!', 'flash_custom_success');
}
$this->redirect('/');
}