Hello,
I've got one problem with Zend_Filter_Input and I don't know how to solve
it. I have:
<?php
$data = array( 'nick' => '',
'email' => '[EMAIL PROTECTED]',
'message' => 'my long message'
);
$filters = array( '*' => new Zend_Filter_StringTrim(),
'nick' => new Zend_Filter_StripTags()
);
$validators = array( 'email' => array( new
Zend_Validate_EmailAddress(),
Zend_Filter_Input::ALLOW_EMPTY => true
),
'nick' => array(
Zend_Filter_Input::PRESENCE => Zend_Filter_Input::PRESENCE_REQUIRED,
Zend_Filter_Input::ALLOW_EMPTY => false
)
);
$input = new Zend_Filter_Input($filters, $validators, $data);
if ($input->hasInvalid())
{
$message = $input->getMessages();
}
?>
If I have empty string in nick field it can't pass but it doesn't work. I
don't need to make any other validation on that field.
Thanks for every help,
Jakub Podhorský