Skip to content
Advertisement

CakePHP how to set a message from Model?

I’m trying to send a specific message from Model in beforeSave() method. Flash messages don’t work. I could send this message from Controller and use some parameters but I don’t this this best solution. Use of print isn’t good either.

So my question is how to send any message to controller/view from model?

Advertisement

Answer

You have to bubble an error message, try this

in your model :

JavaScript

in your controller :

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement