我有三个字段:1. Day 2. Month 和 3. Year。我如何构建一个 zend 验证器来检查不正确的格式,例如 2 月 30 日、4 月 31 日甚至闰年。
这是我的验证在控制器中内置的形式:
$validators = array(
"*" => array("allowEmpty" => true),
"user_status" => array("presence" => "required"),
"fname" => array("presence" => "required"),
"lname" => array("presence" => "required"),
"tel_num" => array(
'digits',
array("StringLength", "minLength" => 8, "maxLength" => 15),
new Zend_Validate_Db_NoRecordExists('usersmeta','meta_value'),
),
"allowEmpty" => false
),