本文整理汇总了PHP中DataValidator::getErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP DataValidator::getErrors方法的具体用法?PHP DataValidator::getErrors怎么用?PHP DataValidator::getErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataValidator
的用法示例。
在下文中一共展示了DataValidator::getErrors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
}
}
}
?>
<section class="content">
<?php
ErrorHandler::displayErrors();
?>
<div>
<div class="notice">Note: Password is automatically set as the
combination of user's first name and last four digits of their phone
number, all lowercase.</div>
<?php
//error could be set elsewhere in the code, so we need retrieve it after the checks, if any
//in this case, we are checking for the usernam, if it is already in the database
$dataErrors = isset($validator) ? $validator->getErrors() : array();
$form = new FormHelper($data, $dataErrors);
//id is important, they should be unique
$form->create(array('class' => array('generic', 'addForm'), 'name' => 'addNewUserForm', 'method' => 'post', 'action' => BASE_DIR . '/admin/addUser.php'));
$form->input(array('class' => 'formRow', 'input' => array('type' => 'select', 'selected' => $userType, 'id' => 'userGroup', 'options' => array('admin' => 'Administrator', 'rmhstaff' => 'RMH Staff Approver', 'socialworker' => 'Social Worker')), 'label' => array('value' => 'User Category')));
$form->input(array('class' => 'formRow', 'input' => array('id' => 'title'), 'label' => array('value' => 'Title')));
$form->input(array('input' => array('id' => 'fname'), 'label' => array('value' => 'First Name')));
$form->input(array('input' => array('id' => 'lname'), 'label' => array('value' => 'Last Name')));
$form->input(array('input' => array('id' => 'phone', 'type' => 'tel'), 'label' => array('value' => 'Phone')));
$form->input(array('input' => array('id' => 'username'), 'label' => array('value' => 'Username')));
$form->input(array('class' => 'formRow', 'input' => array('id' => 'email', 'type' => 'email'), 'label' => array('value' => 'Email')));
if (isset($userType) && $userType == 'socialworker') {
$form->input(array('input' => array('id' => 'hospital'), 'label' => array('value' => 'Hospital Affiliation')));
$form->input(array('input' => array('id' => 'notify', 'selected' => 'yes', 'type' => 'radio', 'options' => array('yes' => 'Yes', 'no' => 'No')), 'label' => array('value' => 'Email Notification')));
}
$form->button();