本文整理汇总了PHP中frontend\models\SignupForm::getFirstErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP SignupForm::getFirstErrors方法的具体用法?PHP SignupForm::getFirstErrors怎么用?PHP SignupForm::getFirstErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类frontend\models\SignupForm
的用法示例。
在下文中一共展示了SignupForm::getFirstErrors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionSignupVerify
public function actionSignupVerify()
{
$request = wanhunet::$app->request;
$phone = $request->post('phone');
$captcha = $request->post('captcha');
$pass = $request->post('password');
$invitation = $request->post('invitation');
$vcode = VerificationCode::findByField($phone);
if ($vcode !== null && $vcode->verify($captcha)) {
$model = new SignupForm();
$model->username = $phone;
$model->password = $pass;
$model->parent = $invitation;
if (($user = $model->signup()) !== null) {
if (wanhunet::$app->getUser()->login($user)) {
$vcode->verifySave();
if ($request->post("action_do", null) === null) {
return $this->redirect(Url::to(['site/main']));
} else {
if ($request->post('wechat_id', null) !== null) {
$member = wanhunet::app()->member;
$wechatInfo = new MemberOther();
$wechatInfo->user_id = $member->id;
$wechatInfo->table = MemberOther::TABLE_WECHAT;
$wechatInfo->row = $request->post('wechat_id');
wanhunet::app()->member->setOtherInfo([$wechatInfo]);
}
return $this->redirect(Url::to(['share/signup-finish']));
}
} else {
return $this->goBack(['info' => '失败请重试'], Url::to(['site/signup']));
}
} else {
return $this->goBack(['info' => current($model->getFirstErrors()), 'signup.phone' => $phone, 'signup.show' => 2], Url::to(['site/signup']));
}
} else {
return $this->goBack(['info' => '验证码错误', 'signup.phone' => $phone, 'signup.show' => 2], Url::to(['site/signup']));
}
}