本文整理匯總了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]);
}