• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cryptical error message: Undefined property: CI_Loader::$base

#1
[eluser]daveario[/eluser]
Hey there,

I know there are a few topics about “Undefined property: CI_Loader::$base” but none of them can solve my problem.

I wrote a module called “Basement“.
Code:
<?php

if (!defined('BASEPATH')) exit('No direct script access allowed');

class Basement extends Model {

function Basement()
{
    parent::Model();
}

function page_title()
{
    $query = $this->db->query(page_query($this->uri->segment(3)));
    if($query->result() > 0) {
        $row = $query->row();
        echo $row->title;
    }
}

}

?>

In my “header” view, loaded by the “page” view, I loaded the model.
Code:
$this->load->model('basement', 'base', 'TRUE');

Now I want to access the functions.
Code:
<?=$this->base->page_title()?>

but it won't work, I get the following error message:
$this->load->model('basement', 'base', 'TRUE');
Quote:Undefined property: CI_Loader::$base

Can someone help me please? I really don't know why it doesn't work.

#2
[eluser]daveario[/eluser]
Hah, solved it, I just loaded the Model in the Controller, not the view.
Sorry for the trouble!

David


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.