Welcome Guest, Not a member yet? Register   Sign In
How can i echo variable of one view page to another view page ?
#2

[eluser]LuckyFella73[/eluser]
It depends what you want to achieve axactly. If your variable never
changes you could DEFINE it and use where ever you want.

For controller-wide usage you can code somthing like the following
in yout controller constructor:
Code:
$this->my_var = "example value";

and send to the views called by your controller
Code:
// method 1:
$data['my_var'] = $this->my_var;
$this->load->view('view_example', $data);

// method 2:
$data['my_var'] = $this->my_var;
$this->load->view('view_another_example', $data);


Messages In This Thread
How can i echo variable of one view page to another view page ? - by El Forum - 06-03-2010, 04:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB