Do I need a model to validate forms?

My client has asked me to create an eight page form. I’d like to avoid juggling eight scenarios in one huge rules() method or making eight different small form models if I can help it.

I figured I would go with a stateful form to accumulate the data I need for the one big AR needed to save all of the results, but now I need to think about validation for the individual pages.

The sample code in the docs makes it look like CActiveForm needs a model for displaying errors and validating. Is there any way I can make the form without needing to make either eight CFormModels or scenarios in a CFormModel version of one big AR?


well maybe you need something like this extension:

Form Wizard

I’ve never used it though :)

I agree with drylko’s suggestion . Although its still tricky to use it… Just go through the comments. Hope it will help you. Don’t fear that it won’t work. It surely works. Best of Luck. :)