三个依赖字段的 Zend 日期验证


Zend Date Validation for three dependend fields

我有三个字段:1. 第 2 天。月和 3.年。我如何构建一个 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
),

Zend 框架已经提供了接受格式为 'yyyy-MM-dd' 的日期字符串Zend_Validate_Date,例如 2013-11-13。