Welcome Guest, Not a member yet? Register   Sign In
redirection question
#1

[eluser]Unknown[/eluser]
Hello CI Community,

I am confused by something. I have several simple functions in my controller like the following:

Code:
function createEmployee()
    {
        $this->load->view('createEmployees');
    }

Upon execution the functions perform their task but I am not redirected back to the main 'view'. I have been following one of the video tutorials and it didn't address this issue. Here is my index function...

Code:
function index()
    {
        $this->load->library('table');
        $employee = array();
        if($query = $this->employees_model->getAll())
        {
            $employee['records'] = $query;
        }
        $this->load->view('home', $employee);
    }

Please help me see the error in my ways... Thanks!
#2

[eluser]Eric Barnes[/eluser]
If I am reading your issue correctly.

Each function in a controller is really designed to display a view so if you use one and do not need a view but want to go back to "index" then you would add a redirect:
Code:
redirect('welcome/index');
#3

[eluser]Unknown[/eluser]
thanks that got me going in the right direction!




Theme © iAndrew 2016 - Forum software by © MyBB