views:

17

answers:

1

Hello to everybody!

I have this code in the __constructor

  $this->Reliability = new Reliability("name","url");

Problem: I got an unexpected strange error:

Fatal error: Class 'Reliability' not found in "/path/"

I'm using the "__autoload" method to call the required classes, but it doesn't work when I'm calling the file in a ModalBOX Window. If I request the file outside the ModalBox evrything goes fine :(

Some tricks to fix it?

thank you very much in advance!

P.S.

this is the __autoload method:

function __autoload($className) { 
  if (file_exists($className . '.php')) {   
      require_once $className . '.php'; 
      return true; 
  }

else return false; }

A: 

Is your autoloader registered in the file displayed in the modalbox?

Maerlyn
Thank you very much for your suggestion, but, even if I changed it, I still got that error about the Class not found.
sciarp
That means your class is not in the place the autoloader is looking for. Try echoing the filename and path it's calling `file_exists` on, so you can see what it is trying to load.
Maerlyn
Done!thank you thank you! Sometimes is just a matter of motivation!(I apologize for my English but it isn't my native language)See ya ;)
sciarp
Glad I could help.
Maerlyn