public function index() { $this->template->content = new View('task'); $this->template->title = 'SMS Task Queue'; $this->template->content->message = Message_Model::get_oldest_available_message(); // If there are no messages, pass "null" if (count($this->template->content->message) == 0) { $this->template->content->message = NULL; } }