Welcome Guest, Not a member yet? Register   Sign In
passing data from one controller function to another
#4

[eluser]daelsepara[/eluser]
One way to pass it is via session flashdata:

Code:
$this->session->set_flashdata('varone', 'value');
redirect('some_page');

in the next controller:

Code:
function some_page()
{
  $varone = $this->session->flashdata('varone');
}

the data is available only (up to) the next server request.

Otherwise, you would code your controllers in the following manner:

Code:
function func2($varone = "", $vartwo = "")
{
}

where the statements inside func2:

Code:
$varone = "", $vartwo = ""

refers to the default value for these variables should func2 be
called when none are given.

Have I understood your problem correctly?


Messages In This Thread
passing data from one controller function to another - by El Forum - 06-14-2010, 08:57 PM
passing data from one controller function to another - by El Forum - 06-14-2010, 09:40 PM
passing data from one controller function to another - by El Forum - 06-14-2010, 10:16 PM
passing data from one controller function to another - by El Forum - 06-14-2010, 10:57 PM
passing data from one controller function to another - by El Forum - 06-15-2010, 08:33 AM
passing data from one controller function to another - by El Forum - 06-15-2010, 07:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB