[eluser]Crucial[/eluser]
Hm. I don't think that will work. I have forms with like 4-5 steps, so we're talking 4-5 different views here, all using the same URL and taking $_POST data. Basically, it's like having 4-5 different forms, all with different input fields and rules, that all have to pass back to the same "controller" and validate for each section before moving on to the next form.
I'm putting controller in quotes because these plugins are actually being stored in the plugin directory, but I'm treating them as controllers in there since they're handling validation and loading views.
I have to limit this to one controller because it's a plugin, it has to be modular so I can add/remove plugins. They're all in one directory so the application can look in this folder and auto-enable anything in there.
Maybe that's confusing. Ok, I have this one page that takes you to a feed creation wizard. You can select from a variety of feed types (standard RSS feed, iTunes podcast, custom XML feeds for things like Flash slideshows, etc.). These are listed in a radio group, and the choices are limited to what's in the plugin directory.
This form works, of course, and I'm using _remap and a route to send the selected radio request to a plugin.php controller (in the controller) directory. This is taking the "short" plugin name (e.g. rss) that's passed in the routing section, and redirecting it to the appropriate plugin_pi.php file in the plugins directory:
Code:
$route['feeds/create/([a-z]+)'] = "plugins/$1";
The plugins.php controller has this in it:
Code:
<?
class Plugins extends Controller {
public function __construct() {
parent::__construct();
}
public function _remap($plugin) {
$this->load->plugin($plugin);
}
}
?>
Just redirecting for now. Each plugin has a file in the plugins directory, and then views, which are in a self-named sub-directory in the views section, e.g.:
Code:
/views/plugins/plugin-name/
I can get the first step of this form to work. It has no $_POST data beforehand and will validate itself and move on. The second page automatically thinks $_POST data has been sent and sends an error. I can clear the $_POST data and either store it in session data, or re-output it in hidden input fields.
The problem comes with the next step. The next step usually comes up with just a blank page, or will redirect back to the first step.
I don't know, I've tried this so many different ways and just can't get it to work. I think my head's still in a fog