【问题标题】:CI 2 - Language class and modelsCI 2 - 语言类和模型
【发布时间】:2012-04-12 01:23:24
【问题描述】:

我注意到一个奇怪的问题,但我似乎找不到任何解释。

在我的一个模型上,我添加了一条错误输出消息以提醒记录不可用,但是当它输出时,我没有得到任何文本,只是一个空白页。

现在语言标签是有效的,我唯一能想到的是语言文件不打算在模型上使用,如果是这样的话,我看不到任何地方都解释过。

我希望有人可以帮助我找到正确的方向,如果我必须将其设置为 false 并处理 ui 上的消息,我会这样做,但不想这样做。

谢谢。

编辑:

这是一个应该有帮助的快速代码片段:

//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.
}

【问题讨论】:

    标签: codeigniter-2 php-5.2


    【解决方案1】:

    我觉得很笨,但我想通了,语言文件还没有加载,ARGH!

    我将不得不回到这个看起来的绘图板上,任何建议,请发布。

    【讨论】:

      猜你喜欢
      • 2023-03-11
      • 1970-01-01
      • 2011-02-11
      • 2016-09-26
      • 2016-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多