display error message from model


When I try to display error message from my model, I got this error with my message

PHP Error


Cannot modify header information - headers already sent by

I pass the error this way

$this->addError("<font color=green>$this->name</font>");

can you tell me how to pass error message from my model?

"Cannot modify header information - headers already sent by" should not be connected to addError.

When you get that error, it usually means you are outputting something before the html headers are sent. You may be using ‘echo’ or ‘print’ or some output function before the layout(s) and view(s) are rendered for the page you are receiving the errors on.

Thanks for this little info. I had a the same error message. With this info I was able to locate a single character has found its way somehow into one of the model file. After removing it all worked again.