本文整理匯總了PHP中Invitation::validateInvitationForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP Invitation::validateInvitationForm方法的具體用法?PHP Invitation::validateInvitationForm怎麽用?PHP Invitation::validateInvitationForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Invitation
的用法示例。
在下文中一共展示了Invitation::validateInvitationForm方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: action_invitation_create
public function action_invitation_create()
{
$login = Session::getLogin();
$type = Arr::init($_REQUEST, 'type', TYPE_INT);
if ($login->getType() < $type || $type < \Member::TYPE_MEMBER || $type > $login->getType() || $login->getFundsLevel() != \Member::FUNDS_LEVEL2) {
throw new PermissionDeniedException();
}
if ($type === \Member::TYPE_SUB_PROMOTER) {
list($valid, $data, $recipient) = \Invitation::validateInvitationForm($_REQUEST);
if ($valid !== true) {
return ControllerDispatcher::renderModuleView(self::MODULE_NAME, 'index', ['member' => $login, 'tab' => 'invitation', 'formErrors' => $data, 'recipient' => $recipient, 'formVal' => $_REQUEST]);
}
if ($data['promoter_id'] === '') {
$data['promoter_id'] = $recipient->getId();
return ControllerDispatcher::renderModuleView(self::MODULE_NAME, 'index', ['member' => $login, 'tab' => 'invitation', 'formVal' => $data, 'recipient' => $recipient]);
}
} else {
$data = \Invitation::initInvitationForm($_REQUEST);
}
\Invitation::create($login, $data, \Propel::getConnection());
return ControllerDispatcher::renderModuleView(self::MODULE_NAME, 'index', ['member' => $login, 'tab' => 'invitation', 'successmsg' => true, 'formVal' => []]);
}