[eluser]deslacker[/eluser]
I'm new to CI and OOP in PHP so please excuse the simple question.
I have a model...and I have a controller...but what I can't figure out is how to display the extracted $data in my view.
I am autoloading the database: $autoload['libraries'] = array('database');
Code:
?php
class Mdl_vehicle extends Model {
function Mdl_vehicle()
{
parent::Model();
}
function get_all_records()
{
$query = $this->db->get('vehicles');
return $query->result_array();
}
}
?
Code:
?php
class Ctl_vehicle extends Controller {
function Ctl_vehicle()
{
parent::Controller();
$this->load->model('mdl_vehicle');
}
function index()
{
$data = $this->mdl_vehicle->get_all_records();
$this->load->view('view_vehicle',$data);
$this->output->enable_profiler(TRUE);
}
}
?