本文整理汇总了PHP中FORM::num_errors方法的典型用法代码示例。如果您正苦于以下问题:PHP FORM::num_errors方法的具体用法?PHP FORM::num_errors怎么用?PHP FORM::num_errors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FORM
的用法示例。
在下文中一共展示了FORM::num_errors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: continue_validating
/**
* Does this field need validation?
* This will return True only if the field has not already generated an error and it has content.
* Descendents use this function to determine whether to continue validation or not.
* @param FORM $form
* @return boolean
*/
public function continue_validating($form)
{
return !$this->is_empty() && !$form->num_errors($this->id);
}
示例2: needs_visible
/**
* Are there errors or values for these fields?
* @param FORM $form
* @return boolean
*/
public function needs_visible($form)
{
/** @var $date_before DATE_TIME */
$date_before = $form->value_for($this->before_name());
/** @var $date_after DATE_TIME */
$date_after = $form->value_for($this->after_name());
return $date_before->is_valid() || $form->num_errors($this->before_name()) || $date_after->is_valid() || $form->num_errors($this->after_name()) || $form->value_for($this->search_type_name()) != Search_date_constant;
}