CodeIgniter Forums

Full Version: Step by Step multi-page cross-controller form?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Tim Stackhouse[/eluser]
Let me know if I'm not explaining this properly, but I have the following:

I've recently finished what could be considered a backend for a multipage branching form using full MVC form with all the logic in place. I'm not working on a Steps controller to bring it all together into one coherent process and I've hit a wall for how to direct the user around. I've come down to three options all of which are less than ideal:

* Rebuild parts of the controller logic in my steps controller: This leads to code duplication - bad.
* Make Steps act as a traffic cop & fling the user around to all my controllers: I need to change around the redirect logic to do this, which I'm trying to avoid with Steps to begin with - bad
* Have Steps take requests and pass to the appropriate controller and keep track of state, allowing a proper progress indicator: Best solution I can think of, bur it breaks MVC by calling other controllers.

I'm kind of at a loss for what I should do in this situation, so any input is greatly appreciated.

El Forum

Calling other controllers does not "break" anything. It's no different than calling a library.

MVC is based on separation of concerns in your application and has nothing to do with your problem.