Welcome Guest, Not a member yet? Register   Sign In
Calling model functions from views
#1

[eluser]Unknown[/eluser]
I can't seem to do it. Every time I try, I get an error message like this:

Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_Loader::$mymodel

Filename: mymodel.php

Line Number: 5

Fatal error: Call to a member function hello() on a non-object in ~/public_html/codeigniter/system/application/views/content/form/forening_redigera.php on line 5

From the view file:
Code:
$this->load->model('mymodel');
echo $this->mymodel->hello();

From the model file:
Code:
function hello()
    {
        $hi = 'hello';
        return $hi;
    }


Messages In This Thread
Calling model functions from views - by El Forum - 01-24-2008, 03:54 PM
Calling model functions from views - by El Forum - 01-24-2008, 03:59 PM
Calling model functions from views - by El Forum - 01-24-2008, 04:58 PM
Calling model functions from views - by El Forum - 01-25-2008, 12:02 AM
Calling model functions from views - by El Forum - 01-25-2008, 08:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB