Welcome Guest, Not a member yet? Register   Sign In
Dynamically insert a form view into a template view
#2

[eluser]gvillavizar[/eluser]
Easy enough, you can load a view into a variable using the third parameter in codeigniter.

So if you are passing a parameter to the controller via the url you only need to do a switch or something.

Code:
switch($parameter)
{
    case 'update_email';
    $data['content'] = $this->load->view('update_email', TRUE);
    break;

    case 'update_password';
    $data['content'] = $this->load->view('update_password', TRUE);
    break;

    case 'update_profile';
    $data['content'] = $this->load->view('update_profile', TRUE);
    break;
}

Something like that.


Messages In This Thread
Dynamically insert a form view into a template view - by El Forum - 02-19-2011, 07:10 PM
Dynamically insert a form view into a template view - by El Forum - 02-20-2011, 12:31 AM
Dynamically insert a form view into a template view - by El Forum - 02-20-2011, 02:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB