[eluser]Joshb[/eluser]
Hi, I'm trying to create a wizard style application but am not sure how to do something...
What I want, is that all pages of the wizard appear as being in the root, ie domain.com/ for every page, rather than domain.com/, domain.com/2, domain.com/3...
I have the following code:
Code:
<?php
class Main extends Controller {
function index()
{
$data = array();
if($this->input->server('REQUEST_METHOD') == 'POST')
{
$this->_process_info();
}
$this->load->view('step1', $data);
}
function _process_info()
{
//validation checks
//
//if(!valid) echo errors
//else go to step 2
$this->_step_2();
}
function _step_2()
{
$this->load->view('step2');
}
}
In the _process_info() function, if validation is successful, I want to go to _step_2() and exit the index function.
i.e. if _process_info successfully validates the data, it should stop what its doing and go to _step_2, otherwise assign errors to $data for output on the step1 view.
What would be the best way to do that? I'm sure its something easy, I just cant think of it...
Thanks,
Josh