D
D
Dmitry2016-07-28 22:06:22
Yii
Dmitry, 2016-07-28 22:06:22

YII2 step-by-step registration, how best to implement?

Good evening.
There was a need to make a step-by-step registration on the site.
Now everything is implemented in a simple way, entered email, pressed a button, received a notification by mail with a confirmation link, login and a generated password.
You need to do this:
1 step. The user enters some text into the text area, clicks "submit".
2 step. Enters email, password, confirms the password, clicks "registration".
3 step. After that, it is transferred to your personal account (authorized), and a letter with a confirmation link is sent to the mail.
I'm interested in how best to organize the execution of the first two steps.
Do with page reload? Then what is the best way to save the data from the previous step?
Or using jquery to scroll the form, do ajax validation?
Who will advise what?
If it doesn't make it difficult, then share links to examples of such an implementation.
Thanks to those who responded.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
IceJOKER, 2016-07-28
@slo_nik

public function actionStepOne(){}
public function actionStepTwo(){}
public function actionStepThree(){}

1. At each stage, you get field data, save it to the session and check it.
2. It is possible on JS/jQuery, on one page display all the fields divided into three blocks, if the block is successfully completed, show the next block.
3. You can stupidly send the form at each step and the parameters in GET, and at the end check all the data.
If you decide to create three actions, then I suppose you need to create three scripts in the model, so that only the fields of this step are checked at each step.
^^^
Try to do something, look, think, and when you reach a dead end - ask a question, show what you did, what didn’t work out, then they will answer more specifically

E
Eugene, 2016-07-29
@Elgorm

Look here . Maybe it will suit you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question