Welcome Guest, Not a member yet? Register   Sign In
Models and the language class
#1

[eluser]elite-board[/eluser]
Hi,

I noticed this recently, when I try to output an error message to a user using the language class, it returns no text.

am I not meant to be able to use the language class in the model layer?

below is my code:

Code:
//fetch topic data.
$this->db->select('id, Name, Description, Level');
$this->db->from('groups');
$this->db->where('id', $gid);
$query = $this->db->get();
$GroupData = $query->row();

//see if we have any records to show.
if($query->num_rows() > 0) {
    $this->setId($GroupData->id);
    $this->setName($GroupData->Name);
    $this->setDescription($GroupData->Description);
    $this->setLevel($GroupData->Level);
} else {
    //no record was found, throw an error.
    show_error($this->lang->line('invalidgid').'<hr />File:'.__FILE__.'<br />Line:'.__LINE__, 500, $this->lang->line('error'));
    log_message('error', 'invalid GroupID was provided.'); //log error in error log.
}

first off yes I verified the language value exists in the language file. I'm really confused on why this is happening.

if anyone thinks I'm heading in the wrong direction, please let me know.

thanks.




Theme © iAndrew 2016 - Forum software by © MyBB