Welcome Guest, Not a member yet? Register   Sign In
Accessing controller variables in the viewer
#1

[eluser]dedavai[/eluser]
I'm having trouble accessing variables created inside the controller from within the viewer. For example, inside the controller (home.php) I have the following:
Code:
function view() {
...
$sub = false;
$this->load->view('home_view');
}
and inside the view file (home_view.php) I have
Code:
<input type="text" name="cp" value="<?=($sub ? "CP value" : "");?>">
However, the $sub never makes it from the controller to the viewer. Is there a special way to reference the variables ?


Messages In This Thread
Accessing controller variables in the viewer - by El Forum - 08-21-2007, 12:18 AM
Accessing controller variables in the viewer - by El Forum - 08-21-2007, 12:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB