I’m a bit of newbie and I’m trying to use CI to get my PHP programming straight. Now I ran into this problem, that I sorta asked before on here: link to thread. (I got an answer to my original problem, not the passing-of-variables question).
The question simply is: how do I pass variables from one function to another? I want all my functions to return to the index() one, and I want to able to send a status message, something like this:
class Test extends Controller {
function Test()
{
parent::Controller();
}
function index()
{
$message = 'I want other functions to replace this text';
$data['message'] = $message;
$this->load->view('testview', $data);
}
function edit()
{
$this->message = 'How to send this message to index()';
$this->index();
}
}
How do I accomplish this? Many thanks in advance.
