Zand Php Cake Php

Posted by : Cristian Cassina
Validator message not showing
Hi everyone,

I'm dealing  with a little problem that I can't simply get rid of.

I have these validation rules in the required model:



 var $validate = array(

               'name' => array(

                   'rule' => 'notEmpty',

                   'message' => 'Il campo codice non può essere

lasciato vuoto'

               ),

               'customer_name' => array(

                 'rule' => 'notEmpty',

                 'message' => 'Il codice cliente non può essere vuoto'

               ),

               'grammatura' => array(

                 'rule' => array('notEmpty', 'numeric'),

                 'message' => 'la scheda deve avere una grammatura'

               )

               );



I probably didn't get the thing right, but if I try to submit the view

with any of these fields empty, it flashes me "Object has been saved

correctly", while it didn't save anything.

What am I doing wrong? Is the setFlash method totally independent from

the error message in the validator?

Thank you



Cristian
 
 
Posted by : Bert Van den Brande
Re : Validator message not showing
Are you setting that flash message yourself ?

You can check if a
save has been succesfull or not by looking at the response that comes
back from the $model->save() method ... either true or false.
 
 
If you have the better reply, then send it to us. We will display your reply after the approval.
Name : 
Email Id :   
Reply :