本文整理汇总了PHP中CheckboxField::setRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP CheckboxField::setRequired方法的具体用法?PHP CheckboxField::setRequired怎么用?PHP CheckboxField::setRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CheckboxField
的用法示例。
在下文中一共展示了CheckboxField::setRequired方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addLastStepQuestions
protected function addLastStepQuestions($controller)
{
$displayPhoto = false;
$displayPhotoUpload = OW::getConfig()->getValue('base', 'join_display_photo_upload');
$avatarValidator = OW::getClassInstance("BASE_CLASS_AvatarFieldValidator", false);
switch ($displayPhotoUpload) {
case BOL_UserService::CONFIG_JOIN_DISPLAY_AND_SET_REQUIRED_PHOTO_UPLOAD:
$avatarValidator = OW::getClassInstance("BASE_CLASS_AvatarFieldValidator", true);
case BOL_UserService::CONFIG_JOIN_DISPLAY_PHOTO_UPLOAD:
$userPhoto = OW::getClassInstance("BASE_CLASS_JoinUploadPhotoField", 'userPhoto');
$userPhoto->setLabel(OW::getLanguage()->text('base', 'questions_question_user_photo_label'));
$userPhoto->addValidator($avatarValidator);
$this->addElement($userPhoto);
$displayPhoto = true;
}
$displayTermsOfUse = false;
if (OW::getConfig()->getValue('base', 'join_display_terms_of_use')) {
$termOfUse = new CheckboxField('termOfUse');
$termOfUse->setLabel(OW::getLanguage()->text('base', 'questions_question_user_terms_of_use_label'));
$termOfUse->setRequired();
$this->addElement($termOfUse);
$displayTermsOfUse = true;
}
$this->setEnctype('multipart/form-data');
$event = new OW_Event('join.get_captcha_field');
OW::getEventManager()->trigger($event);
$captchaField = $event->getData();
$displayCaptcha = false;
$enableCaptcha = OW::getConfig()->getValue('base', 'enable_captcha');
if ($enableCaptcha && !empty($captchaField) && $captchaField instanceof FormElement) {
$captchaField->setName('captchaField');
$this->addElement($captchaField);
$displayCaptcha = true;
}
$controller->assign('display_captcha', $displayCaptcha);
$controller->assign('display_photo', $displayPhoto);
$controller->assign('display_terms_of_use', $displayTermsOfUse);
if (OW::getRequest()->isPost()) {
if (!empty($captchaField) && $captchaField instanceof FormElement) {
$captchaField->setValue(null);
}
if (isset($userPhoto) && isset($_FILES[$userPhoto->getName()]['name'])) {
$_POST[$userPhoto->getName()] = $_FILES[$userPhoto->getName()]['name'];
}
}
}