本文整理匯總了PHP中frontend\models\SignupForm::setAuthProviderTitle方法的典型用法代碼示例。如果您正苦於以下問題:PHP SignupForm::setAuthProviderTitle方法的具體用法?PHP SignupForm::setAuthProviderTitle怎麽用?PHP SignupForm::setAuthProviderTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類frontend\models\SignupForm
的用法示例。
在下文中一共展示了SignupForm::setAuthProviderTitle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionSignup
public function actionSignup()
{
$authProviderName = Yii::$app->session->get('game/register/authProviderName');
$authProviderTitle = Yii::$app->session->get('game/register/authProviderTitle');
$externalUserAttributes = Yii::$app->session->get('game/register/attributes');
$model = new SignupForm();
$model->setAuthProviderName($authProviderName);
$model->setAuthProviderTitle($authProviderTitle);
$model->externalUserAttributes = $externalUserAttributes;
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
Yii::$app->session->remove('game/register/authProvider');
Yii::$app->session->remove('game/register/attributes');
if (Yii::$app->getUser()->login($user)) {
return $this->goHome();
}
}
} else {
$model->username = $model->getExternalUserName();
}
return $this->render('signup', ['model' => $model]);
}