本文整理汇总了PHP中frontend\models\SignupForm::sendEmailActiveAccount方法的典型用法代码示例。如果您正苦于以下问题:PHP SignupForm::sendEmailActiveAccount方法的具体用法?PHP SignupForm::sendEmailActiveAccount怎么用?PHP SignupForm::sendEmailActiveAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类frontend\models\SignupForm
的用法示例。
在下文中一共展示了SignupForm::sendEmailActiveAccount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionRegister
public function actionRegister($referrer_code = "")
{
Yii::$app->view->title = "Lifeguard - Register";
if ($referrer_code != "") {
$isDisableReferrer = true;
} else {
$isDisableReferrer = false;
}
$model = new SignupForm();
$model->referrer = $referrer_code;
if ($model->load(Yii::$app->request->post())) {
$model->code = $this->random_string(5);
$model->username = $model->email;
$model->status = User::STATUS_WAITING;
if ($user = $model->signup()) {
//Gui mail active account.
if ($model->sendEmailActiveAccount($user)) {
Yii::$app->session->setFlash('success', 'Thank you for joining us! We have sent you an email to validate your account, please click on the link in your email to login.');
} else {
Yii::$app->session->setFlash('error', 'Cannot send a email confirm your registration.');
}
} else {
Yii::$app->session->setFlash('error', 'The register is error.');
}
}
$states = Common::$states;
return $this->render('register', ['model' => $model, 'states' => $states, 'isDisableReferrer' => $isDisableReferrer]);
}