开发者

multi-step registration

I am currently using sfDoctrineGuardPlugin and sfDoctrineForkedApplyPlugin for my user management.

This works well for me and users can register/login etc

The problem comes with the registration part. The Profile relation that I have is getting particularly large in terms of fields users are required to fill out on registration.

I was thinking of possibly creating a multistep process, possibly 2 steps.

Step 1 is the main details, such as name, username, password etc Step 2 is the address and my othe开发者_StackOverflowr fields

I don't want my users to scroll down to fill out 25 fields on a single form

I'm not entirely sure how I'd do this and I cannot find any information regarding carrying out this.

Has anyone ever done this before and If so, could someone point me in the right direction of how I'd do this?

Thanks


I'd create a form class for every step. When processing the submitted form, save the submitted part to the session if validation passes.

In the end you'll have an array of validated values for every step, just compose your model object out of them, and save the object.


Here is a generic way of handling multi-step forms in Symfony:

How to 'validate' a Symfony form in steps - instead of calling $form->isValid()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜