Hi, I am trying to get the Zend_Filter_Input to work as required on a simple login form.
Here is my code
$filters = array('username' => 'StringTrim', 'password' => 'StringTrim');
$validators = array(
'username' => array('Alnum', 'presence' => 'required'),
'password' => array('Alnum', 'presence' => 'required')
);
$input = new Zend_Filter_Input($filters,$validators);
print_r($input->getMissing());
and the response is this
Array
(
[username] => Array
(
[0] => Field 'username' is required by rule 'username', but the field is missing
)
[password] => Array
(
[0] => Field 'password' is required by rule 'password', but the field is missing
)
)
I am referred to the official docs. Why is it saying rule "username" and rule "password"
here ?
Thanks