本文整理汇总了PHP中frontend\models\SignupForm类的典型用法代码示例。如果您正苦于以下问题:PHP SignupForm类的具体用法?PHP SignupForm怎么用?PHP SignupForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SignupForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: actionSignup
public function actionSignup()
{
if (!Yii::$app->user->isGuest) {
return $this->goBack();
}
//new a signup model here
$signUpModel = new SignupForm();
if (Yii::$app->request->post()) {
//load all the data from post into model
if ($signUpModel->load(Yii::$app->request->post())) {
//if successed
if ($user = $signUpModel->signup()) {
if (Yii::$app->getUser()->login($user)) {
//sent a eamil for validation
$mail = Yii::$app->mailer->compose();
$mail->setTo($user->username);
$mail->setSubject("账号激活");
$validate_url = 'http://localhost/project_colfans/yii2forcolfans/frontend/web/site/validateaccount?user=' . $user->id . '&validation=' . $user->validation;
$mail->setHtmlBody('点击下方链接激活账号,如果您并没有在Colfans注册账号,请忽略此邮件<a style="color:#4383E5;font-size:16px;" href="' . $validate_url . '" target="_blank">点这里</a>');
$mail->send();
$this->redirect(['index', 'message' => 'newaccount', 'email' => $user->username]);
}
}
}
}
return $this->render('signup', ['signUpModel' => $signUpModel]);
}
开发者ID:BonVa,项目名称:colfans,代码行数:27,代码来源:SiteController.php
示例2: createManager
public function createManager()
{
/*echo "Title = ". $this->title. "</br>";
echo "Description = ".$this->description. "</br>";
echo "Password = ".$this->password. "</br>";
echo "ShopID = ".$this->shop_id. "</br>";*/
$UserAsManager = new SignupForm();
$UserAsManager->password = $this->password;
$UserAsManager->email = $this->email;
$UserAsManager->firmname = '';
$user = $UserAsManager->signup(false);
if ($user) {
$this->userID = $user->id;
$manager = new Manager();
$manager->title = $this->title;
$manager->shop_id = $this->shop_id;
$manager->description = $this->description;
$manager->user_id = $this->userID;
//$manager->ssid = helper::getSsid();
if ($manager->save(true)) {
$this->id = $manager->id;
return true;
} else {
return false;
}
} else {
return false;
}
}
开发者ID:best-nazar,项目名称:gb-yii2,代码行数:29,代码来源:managerAssistant.php
示例3: actionCreate
/**
* Creates a new UserInfo model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new UserInfo();
$modelSignUp = new SignupForm();
$arrSingup = Yii::$app->request->post("SignupForm");
$modelSignUp->username = $arrSingup["username"];
$modelSignUp->password = $arrSingup["password"];
$modelSignUp->email = $arrSingup["email"];
$arrUserInfo = Yii::$app->request->post("UserInfo");
$model->load(Yii::$app->request->post());
$user = $modelSignUp->signup();
if ($user !== null) {
$model = $this->findModel($user->id);
$model->first_name = $arrUserInfo["first_name"];
$model->last_name = $arrUserInfo["last_name"];
$model->full_name = $arrUserInfo["full_name"];
$model->phone = $arrUserInfo["phone"];
$model->position = $arrUserInfo["position"];
$model->manager = $arrUserInfo["manager"];
if ($model->save()) {
return $this->redirect(['view', 'id' => $model->user_id]);
}
}
return $this->render('create', ['model' => $model, 'modelSignUp' => $modelSignUp]);
}
开发者ID:ncuong,项目名称:lifeguard,代码行数:30,代码来源:UserInfoController.php
示例4: actionSignupSubmit
public function actionSignupSubmit()
{
if (isset(Yii::$app->request->post('SignupForm')['checkbox'])) {
$IsLogin = true;
} else {
$IsLogin = false;
}
$model = new SignupForm();
if (Yii::$app->request->isAjax) {
Yii::$app->response->format = Response::FORMAT_JSON;
$model->load(Yii::$app->request->post());
return ActiveForm::validate($model);
}
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($user = $model->signup() && $IsLogin) {
// если есть чекбокс залогинить
$model->login($user);
return $this->redirect('/shop/index');
} else {
// если не просили залогинить
//vd(yii::$app->request->isAjax);
Yii::$app->response->format = Response::FORMAT_JSON;
Yii::$app->getSession()->setFlash('success', 'Вы успешно зарегистрировались');
return $this->redirect('/shop/index');
}
}
return $this->redirect('/shop/signup');
}
开发者ID:kotmonstr,项目名称:full-shop,代码行数:28,代码来源:DefaultController.php
示例5: actionCreate
/**
* Creates a new User model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post()) && $model->signup()) {
return $this->redirect(['index']);
} else {
return $this->render('create', ['model' => $model]);
}
}
开发者ID:Ermac1988,项目名称:site-yii2-advanced,代码行数:14,代码来源:UserController.php
示例6: submit
/**
* @param array $signupData
*/
public function submit(array $signupData)
{
$signupForm = new SignupForm();
foreach ($signupData as $field => $value) {
$inputType = $field === 'body' ? 'textarea' : 'input';
$this->actor->fillField($inputType . '[name="' . $signupForm->formName() . '[' . $field . ']"]', $value);
}
$this->actor->click('signup-button');
}
开发者ID:wangjstu,项目名称:PHPSTU,代码行数:12,代码来源:SignupPage.php
示例7: actionCreateuser
/**
* Creates a new User for current Tenant.
* If creation is successful, the browser will be redirected to Tenant 'view' page.
* @return mixed
*/
public function actionCreateuser()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
return $this->actionView($model->tenant_id);
}
}
return $this->render('createuser', ['model' => $model]);
}
开发者ID:antonio74,项目名称:daduu42,代码行数:15,代码来源:TenantController.php
示例8: actionSignupSubmit
public function actionSignupSubmit()
{
Yii::$app->response->format = Response::FORMAT_JSON;
$model = new SignupForm();
if ($model->load(["SignupForm" => Yii::$app->request->post()]) && ($user = $model->signup())) {
if (Yii::$app->getUser()->login($user)) {
return ["code" => 200, "msg" => "注册成功!"];
}
}
return ["code" => 300, "msg" => "注册失败", "errors" => $model->errors];
}
开发者ID:xiaomige,项目名称:giishop,代码行数:11,代码来源:SiteController.php
示例9: saveMember
public function saveMember($event)
{
/** @var \modules\member\models\VerificationCode $verificationCode */
/** @var Event $event */
$verificationCode = $event->sender;
$phone = $verificationCode->field;
if (wanhunet::$app->user->isGuest) {
$model = new SignupForm();
$model->load(['username' => $phone, 'phone' => $phone, 'password' => wanhunet::$app->request->post('password')]);
$model->signup();
}
}
开发者ID:suyuanen,项目名称:p2p,代码行数:12,代码来源:Member.php
示例10: actionSignup
/**
* Регистрация
* @return string|\yii\web\Response
*/
public function actionSignup()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
if (Yii::$app->getUser()->login($user)) {
return \Yii::$app->getResponse()->redirect(Yii::$app->params['backend_url']);
}
}
}
return $this->render('signup', ['model' => $model]);
}
开发者ID:vlamug,项目名称:landing-page-crm,代码行数:16,代码来源:IndexController.php
示例11: actionSignup
public function actionSignup()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
if (Yii::$app->getUser()->login($user)) {
return $this->goHome();
}
}
}
return $this->render('signup', ['model' => $model]);
}
开发者ID:KanKai,项目名称:dsale2015,代码行数:12,代码来源:UserController.php
示例12: actionSignup
public function actionSignup()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
if (Yii::$app->getUser()->login($user)) {
\Yii::$app->getSession()->setFlash('success', 'Ви успішно зареєструвались. Дякуємо, що скористались нашим сервісом.');
return $this->goHome();
}
}
}
return $this->render('signup', ['model' => $model]);
}
开发者ID:VitaliyProdan,项目名称:hr,代码行数:13,代码来源:SiteController.php
示例13: actionSignup
public function actionSignup()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
Yii::$app->db->createCommand()->insert('{{%user_profile}}', ['user_id' => $user->id])->execute();
if (Yii::$app->getUser()->login($user)) {
return $this->goHome();
}
}
}
return $this->render('signup', ['model' => $model]);
}
开发者ID:xingcuntian,项目名称:iisns,代码行数:13,代码来源:SiteController.php
示例14: actionSignup
public function actionSignup()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
if (Yii::$app->getUser()->login($user)) {
Yii::$app->getSession()->setFlash('success', '申请注册成功,请耐心等待账号激活');
return $this->goHome();
}
}
}
return $this->render('signup', ['model' => $model]);
}
开发者ID:dalinhuang,项目名称:wethepeople,代码行数:13,代码来源:SiteController.php
示例15: actionRegister
public function actionRegister()
{
$model = new SignupForm();
//if($model->load(\Yii::$app->request->post()) && $model->validate())
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
if (Yii::$app->getUser()->login($user)) {
return $this->goHome();
}
}
}
return $this->render('register', ['model' => $model]);
}
开发者ID:vecherskyy,项目名称:dom,代码行数:13,代码来源:MainController.php
示例16: actionRegister
public function actionRegister()
{
$model = new SignupForm();
if (\Yii::$app->request->isAjax && \Yii::$app->request->isPost) {
if ($model->load(\Yii::$app->request->post())) {
\Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($model);
}
}
if ($model->load(\Yii::$app->request->post()) && $model->signup()) {
\Yii::$app->session->setFlash('success', 'Register Success');
}
return $this->render("register", ['model' => $model]);
}
开发者ID:eshaft,项目名称:yii2shp,代码行数:14,代码来源:MainController.php
示例17: actionSignup
/**
* @return string|\yii\web\Response
* @throws \yii\web\NotFoundHttpException
*/
function actionSignup()
{
$sign_model = new SignupForm();
if ($sign_model->load(Yii::$app->request->post())) {
if ($user = $sign_model->signup()) {
if (Yii::$app->getUser()->login($user)) {
return $this->goHome();
}
}
}
$js = '$("#sign-modal").modal("show")';
$this->getView()->registerJs($js);
return $this->render('signup', ['sign_model' => $sign_model]);
}
开发者ID:Adzhantis,项目名称:chat-yii2,代码行数:18,代码来源:ShowmodalController.php
示例18: actionSignup
public function actionSignup()
{
$this->title = '用户注册' . ' - ' . Yii::$app->name;
$this->description = '';
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
if (Yii::$app->getUser()->login($user)) {
return $this->goHome();
}
}
}
return $this->render('signup', ['model' => $model]);
}
开发者ID:npk,项目名称:v2sex,代码行数:14,代码来源:AccountController.php
示例19: actionRegister
public function actionRegister()
{
$this->layout = 'inner';
$model = new SignupForm();
// $model->scenario = 'short_register';
if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {
Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($model);
}
if ($model->load(Yii::$app->request->post()) && $model->signup()) {
Yii::$app->session->setFlash('success', 'Register success');
}
return $this->render('register', ['model' => $model]);
}
开发者ID:scorp7mix,项目名称:yii,代码行数:14,代码来源:MainController.php
示例20: actionSignup
public function actionSignup()
{
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
$model->imageFile = UploadedFile::getInstance($model, 'imageFile');
if ($user = $model->signup()) {
//$model->imageFile = UploadedFile::getInstance($model, 'imageFile');
if (Yii::$app->getUser()->login($user)) {
return $this->goHome();
}
}
}
return $this->render('signup', ['model' => $model]);
}
开发者ID:arfo90,项目名称:fp-app,代码行数:14,代码来源:SiteController.php
注:本文中的frontend\models\SignupForm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论