I\'m executing the following query in the get_distribuidor() function of my model:
public function get_distribuidor()
{
$this->load->helper(\'url\'
$teste=$this->fichas_model->get_distribuidor();
$this->load->view('produtos/ponto1',$data, $teste);
should be:
$data['teste'] = $this->fichas_model->get_distribuidor();
$this->load->view('produtos/ponto1',$data);
The 3rd parameter for view()
is used if you want to grab the content of view()
into a variable. To pass data to the view you need to add it as an array item of $data
.
For Example:
$data = array(
'title' => 'My Title',
'heading' => 'My Heading',
'message' => 'My Message'
);
$this->load->view('blogview', $data);
// You then access $title, $heading, $message in the view file
What you are doing with above edit is the following essentially:
$data = array(
'teste' => $this->fichas_model->get_distribuidor()
);
$this->load->view('produtos/ponto1', $data);
// You then access $teste in the view file,
// which will be an array so you can access $teste['morada']