Welcome Guest, Not a member yet? Register   Sign In
Model function references not recognized
#1

[eluser]Frank Cole[/eluser]
Hi all,

Looking for some help here. After my hosting provider upgraded to PHP 5.2.5, Models are no longer working as expected.

I made a fresh install of CI and modified the simple welcome script that comes with it to demonstrate:

Contorller: welcome.php
Code:
<?php

class Welcome extends Controller {

        function Welcome()
        {
                parent::Controller();
        }

        function index()
        {
                $this->load->view('welcome_message');
                $this->load->model('Welcome_model');
                $this->Welcome_model->helloWorld();   // The Model error occurs here...
        }
}
?>

Model: welcome_model.php
Code:
<?php

class Welcome_model extends Model
{
        function Welcome_model()
        {
                parent::Model();
        }

        function helloWorld()
        {
                echo "Hello World!";
        }
}
?>

Error: from CI and PHP debug
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Welcome::$Welcome_model

Filename: controllers/welcome.php

Line Number: 14

Fatal error: Call to a member function helloWorld() on a non-object in /www/htdocs/system/application/controllers/welcome.php on line 14

PHP Version 5.2.5
CI Version 1.5.4

Please somebody tell me there is some really simple fix to this.....

Frank


Messages In This Thread
Model function references not recognized - by El Forum - 01-01-2008, 04:24 PM
Model function references not recognized - by El Forum - 01-01-2008, 04:53 PM
Model function references not recognized - by El Forum - 01-01-2008, 07:48 PM
Model function references not recognized - by El Forum - 01-01-2008, 10:28 PM
Model function references not recognized - by El Forum - 01-17-2008, 09:09 AM
Model function references not recognized - by El Forum - 01-17-2008, 09:26 AM
Model function references not recognized - by El Forum - 01-17-2008, 09:34 AM
Model function references not recognized - by El Forum - 01-17-2008, 09:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB