With Zend framework 1.6 I recive a POST request like this:
array(2) {
["checkins"] => array(18) {
["nome"] => string(6) "MYNAME" //the field is correctly filled
["pec"] => string(0) ""
["sito_web"] => string(0) ""
["note"] => string(0) ""
}
["users"] => array(19) {
["email"] => string(29) "email@gmail.com"
["u_id"] => string(1) "1"
}
}
To Validate the 'nome' field I am using Zend Input Filter. This is my validator array:
$validators = array (
'nome' => array (
'presence' => 'required'
));
$params = $this->getRequest ()->getPost ();
$input = new Zend_Filter_Input ( array (), $validators,$params );
if (! $input->isValid ()) {
print_r($input->getMessages ());
}
It seems that the validation is not well formed becouse I recive the message:
Field 'nome' is required by rule 'nome', but the field is missing
In my opinion there is an error in my $validators array, but I can't find it.