Accessing controller variables in the viewer |
[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() { Code: <input type="text" name="cp" value="<?=($sub ? "CP value" : "");?>">
[eluser]Michael Wales[/eluser]
Variables must be passed within an array to the view from the controller. Controller: Code: function view() { View: Code: <input type="text" name="cp" value="<?= $sub ? "CP Value" : ""); ?>"> Please read the View documentation and the Loader documentation. |
Welcome Guest, Not a member yet? Register Sign In |