Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB