Welcome Guest, Not a member yet? Register   Sign In
Model Loading problem
#1

[eluser]Xobb[/eluser]
Hello,

I've got the following problem with the code:
File: system/application/controllers/article.php
Code:
class Article extends Controller
{

    function Article()
    {
        parent::Controller();
        $this->load->scaffolding('article');
        $this->load->model('article', 'art');
    }
}

File: system/application/models/article.php
Code:
class Articlemodel extends Model  {
    function  ArticleModel()
    {
        parent::Model();
    }
}

The error:
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Article::$UserTemp

Filename: libraries/Loader.php

Line Number: 921

Fatal error: Call to a member function _assign_libraries() on a non-object in C:\Programs\VertrigoServ\www\cignit\system\libraries\Loader.php on line 921

I've installed FreakAuth and nothing else.

Thank you for help in advance.

Ps.: Please add the information about loading models to: Loader Manual
#2

[eluser]jabbett[/eluser]
At first glance, I noticed that your model's filename should be set differently, per the User Guide:

"The file name will be a lower case version of your class name."

If your model class name is Articlemodel, your filename should be articlemodel.php, not article.php.

But considering you've got a library loader error, I'd start by checking your FreakAuth installation and taking up the problem with them.
#3

[eluser]Eric Barnes[/eluser]
Also I see this:
Code:
class Articlemodel extends Model  {
    function  ArticleModel()

Which should be:
Code:
class Articlemodel extends Model  {
    function  Articlemodel()

and:
Code:
$this->load->model('article', 'art');

Should be:
Code:
$this->load->model('articlemodel', 'art');
Remember case is important.
#4

[eluser]Xobb[/eluser]
thank you, guys. Really, I had to load this:
Code:
$this->load->model('articlemodel', 'art');




Theme © iAndrew 2016 - Forum software by © MyBB