Welcome Guest, Not a member yet? Register   Sign In
Multiple views. One function or many in the controller?
#1

[eluser]Unknown[/eluser]
I'm fairly new at this and I have a question about style. I have some logic that's basically like this:

Code:
If (user says no) then
    Display a view with a radio box asking for a reason.
                o  Not enough time
                o  too much money
                o  Already done this

Depending on feedback, if it's too much money. Display another view
                How much would you be willing to pay? _______

If the user didn't enter a numeric or didn't enter anything, ask again:
                How much would you be willing to pay? _______

THEN, In any case, store all the information provided.


To me it seems like this is all one logical unit, and my first thought was to create just one function that would get called on submit of both these views. But then my question is -- what is the right way to pass the context back and forth from the controller to the views?

The other way to do this would be to have a different submit function for each view, but this seems like the flow could get very complex very quickly. Even with this simple case you'd have 4 functions.

It seems like this is a fairly common thing to do but I haven't found an example, so any help is much appreciated.

R


Messages In This Thread
Multiple views. One function or many in the controller? - by El Forum - 12-06-2010, 08:54 PM
Multiple views. One function or many in the controller? - by El Forum - 12-07-2010, 07:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB