Hello, i'm new in CI , and i don't understand something.I have a model like
A controller
And i don't know in view (contact.php) how i can foreach($data) from model.How pass something like this in good practice?Thank u.
PHP Code:
class Contact_model extends CI_Model {
public function start()
{
$query = $this->db->get('utilizatori', 10);
return $query->result();
}
}
A controller
PHP Code:
class Contact extends CI_Controller{
public function index(){
$this->load->model('Contact_model');
$data = $this->Contact_model->start();
//here i added for testing a var_dump($data) and show me results from mysql successfully
$this->load->view('contact',$data);
}
}
And i don't know in view (contact.php) how i can foreach($data) from model.How pass something like this in good practice?Thank u.