public function actionCreateAccount() { $this->layout = 'frontend'; $model = new \app\models\Person(['scenario' => 'create']); if ($model->load(Yii::$app->request->post()) && $model->validate()) { if ($model->save()) { //Send activation email // Yii::$app->mailer->compose('/mail/default',[ // 'auth_key' => $model->auth_key // ]) // ->setFrom('*****@*****.**') // ->setTo($model->email) // ->setSubject('Global Travel Alliance - Account Activation') // ->send(); Yii::$app->user->login($model, 3600 * 24 * 30); // Yii::$app->session->setFlash('accountCreated'); return $this->redirect(['/']); } } return $this->render('create-account', ['model' => $model]); }
echo $form->field($model, 'address1')->textInput(); ?> </div> <div class="col-md-6"><?php echo $form->field($model, 'address2')->textInput(); ?> </div> </div> <div class="row"> <div class="col-md-4"><?php echo $form->field($model, 'city')->textInput(); ?> </div> <div class="col-md-4"><?php echo $form->field($model, 'state')->dropDownList(app\models\Person::returnStates(), ['prompt' => 'State / Province']); ?> </div> <div class="col-md-3"><?php echo $form->field($model, 'zipcode')->textInput(); ?> </div> </div> </div> <div class="spacer30"></div> <div class="well" id="agent"> <h4>Agent Information</h4> <div class="row">