當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataValidator::getErrors方法代碼示例

本文整理匯總了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();
開發者ID:kumarsivarajan,項目名稱:rmh-roomreservation-maker,代碼行數:31,代碼來源:addUser.php


注:本文中的DataValidator::getErrors方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。