CodeIgniter Forums
Step by Step multi-page cross-controller form? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Step by Step multi-page cross-controller form? (/thread-19088.html)



Step by Step multi-page cross-controller form? - El Forum - 05-27-2009

[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.


Step by Step multi-page cross-controller form? - El Forum - 05-27-2009

[eluser]wiredesignz[/eluser]
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.