In your controller you first set the error message when you want it to display
if(sizeof($this->$mainModelName->validationErrors) > 0){ $this->Session->setFlash('Please fill in all compulsory fields and rectify errors'); }
Then you just call the flash function in the class "Session" in your view or layout and put it inside the element you want it to display
<div class="form-error" align="center"><?php $session->flash();?></div>
By PHPin24 @ 2009-08-26 08:13:55
|