我在 Zend Framework 中使用 4 阶段注册页面。
I am using Filter Class. All validations works fine and display error in their approriate place(near the element), If there is any Issue.
但我对“日期”元素有疑问。它不会像其他验证器那样给出错误,并且在日期格式无效的情况下会破坏页面。
我正在使用喜欢
$this->add(array(
'name' => 'user_profile_dob',
'type' => 'Zend\Form\Element\Date',
'options' => array(
'label' => 'Birth Date',
),
'attributes' => array(
'id' => 'user_profile_dob',
'readonly' => true,
'placeholder' => date("m/d/y"),//set selecarray()ted to '1'
'min' => '1800-01-01',
'max' => '2010-01-01',
)
));
我错过了什么
如何使用日期元素,使其像其他人一样显示错误。现在它显示分页符错误
An error occurred
An error occurred during execution; please try again later.
Additional information:
Zend\Filter\Exception\InvalidArgumentException
File:
C:\wamp\www\1625\vendor\ZF2\library\Zend\Filter\DateTimeFormatter.php:60
Message:
Invalid date string provided