Undefined variable: users
APPPATH/views/drafts/_form.php @ line 19
Here's the code:
Model:
public static function get_users() {
$results = DB::select('id', 'username')
->from('users')
->as_assoc()
->execute();
return $results;
}
Controller
$results = Model_Draft::get_users();
$users = array();
foreach($results as $item)
{
$users[$item['id']] = $item['username'];
}
$view = View::forge('drafts/create');
$view->set('users', $users);
$this->template->title = 'Drafts';
$this->template->content = $view;
It looks like you're new here. If you want to get involved, click one of these buttons!