I am getting array value from model and that value I have to pass the other function
Controller
First function
public function example_from_view(){
$int_id = $this->session->userdata['int_url_id']['int_id'];
$result['data']=$this->formbuilder_Model->check_example_form_builder_fields($int_id);
print_r($result['data']); //I have to pass this array to second function so I tried $this->new_example_added($result);
$this->load->view('user-example-form',$result);//passing elements to the view page
}
Second function
public function new_example_added($result)
{
print_r($result['data']);
$this->load->view('user-example-form', $result);
}
View
foreach ($data as $key) {
echo $exp_fields_name=$key->fields_name;
}
But I am getting in view page undefined variable: data and Undefined variable: result
.
I want to use without a session. Would you help me out in this?