Keep getting undefined variable error trying to pass variable into view |
Here is my controller
Code: $this->form_validation->set_rules('chipNumber', 'Chip Number', 'required'); and here is my view Code: <?php Essentially I'm trying to reload the view if form_validation fails, with the $data array set in the controller. It works ok except everytime I load the view, whether form_validation has had the chance to run or not I get an error that says Undefined Variable $data. Not sure what the right way is to go about this
The array that you pass to a view (from within your controller), is automatically extracted.
If you assigned $data['message'] = ... then your view will recognize $message, not $data. |
Welcome Guest, Not a member yet? Register Sign In |