Welcome Guest, Not a member yet? Register   Sign In
Unable to load models!
#1

[eluser]eyalpor[/eluser]
Hello,
This started suddenly - one moment everything worked fine and the next I am unable to load any model.
I am working on LAMP under kubuntu 12.04.
I have tried different directories on my server with the same sorry results.
What I get is a blank screen with no error messages, except if i put "or die()" after the call for the model.
I looked at all I could find on the Net but to no avail.

Model sample looks like this:

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

class Test extends CI_Model{

function __construct(){
parent :: __construct();
}

function success(){
return 'success';
}
}


The file's name is test_model.php under models sub folder,
and the call:

public function index()
{
$this->load->model('test_model');

}

I will be forever in your debt.
Eyal
#2

[eluser]CroNiX[/eluser]
Since your filename is test_model.php, the class name should be Test_model...
Code:
class Test_model extends CI_Model {
#3

[eluser]eyalpor[/eluser]
Thanx for the reply, but that was not the problem.
I must say, this platform is spooky!
After closing the computer for few hours, I rebooted it, tested. and again - nothing.
On my search for error messages I got to the Appache error log, and though there were no error messages that could shed light on this, after refreshing the page for the nth time, lo and behold! a db error from my long missing model has arrived!
after removing the "or die" messages from all of my db code, it just came back. as if nothing has ever happened!
The only problem I detected which (might) be attributed is that I opened the css file with a different app and it went out of sync so I had to recode it in my Eclipse.
This is weird - it did not come back immediately but gradually through 4-5 refresh actions.
I wonder, what if something like that happens on a live site?...




Theme © iAndrew 2016 - Forum software by © MyBB