I have written the following function in the locations_model it does what I want it to but am wondering if I should be using the fuel_model here? any tips would be welcomed as I am new to codeigniter and fuel.
function get_europe() {
$europes = fuel_model('locations',array('find' => 'all', 'where' => array('europe' => 'yes', 'published' => 'yes')));
foreach($europes as $europe) {
$data[$europe->id] = $europe->name;
}
return $data;
}
Comments
function get_europe() { $CI =& get_instance(); $europes = $CI->locations_model->find_all(array('europe' => 'yes')); foreach($europes as $europe) { $data[$europe->id] = $europe->name; } return $data; }
Note that I removed the published => 'yes'. This will be done automatically on the front end.