I am building an application for a client which is a step by step tool that allows the user to enter data for different "sections" that is later output into a html document they can download
Im aiming for this application to be very flexible so that any changes from the client dont require a lot of rebuilding.
I am using the Codeigniter framework.
The way I am currently looking at it is, I have each step defined in a database table called "steps"
On initialisation the application loads this table and starts at step 0, through to 10 - that's all pretty simple, it loads a new view for each step which is essentially a template
Each step might require either the user enters some data into textboxes, or textareas and other steps require they select values from radio buttons.
Different steps require some different processing, ie the text is just stored in the db, the radio buttons are totaled and averaged etc, and also each steps will have different validation rules
I want to build it with enough flexibility so that if the client changes things later, we wont have to rebuild the app, so that is why Ive created the steps as rows in a db table, but im unsure how I would go about handling each different step in terms of processing the data differently and the different validation. I could have a single function with a whole bunch of conditionals, but this seemed to get quite messy and didnt seem right.
I hope this makes sense, so I guess my question is, what is the best approach to this?