I have a view file update.php and contains the following code:
php foreach ($record as $my_records)
$val1=$my_records['name'];
$val2=$my_records['faculty'];
$val3=$my_records['level'];
$val4=$my_records['year'];
?>
php endforeach
And I have a controller with a function update and this controller gets the record from model like this:
$data['record']=$this->myproject_model->get_all_values($rollno);
and then pass those records on the view as follows
$this->load->view('iproject/update',$data);
But, I need to send my own values to the view from the controller. That is, I need to clear the data I got from model and send my own values to the view for some cases. So, how to put my own data in the $data['record'] array and fetch those on in the view in the same way as shown in the above update.php code?
You can send static data like this:
You can send this
$dataarray to the view as how you send$datapreviously and you can access it.