• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
class_exists unusable

I was building a class "setting" to use "const",and I put in the "application/config" directory, but when executing Setting:: they have error Fatal error: Class 'Setting' not found in D: \ appserv \ www \ news \ application \ controllers...
Please help me!

Unless you require that class, your code does not know it exists. You could perhaps put it in the autoload array?

Nothing in the application/config directory is expected to be a class.

True. The CI way to do functions like that is usually to create and load a helper. However if he wants to break out of the mold all he would need to do is require the file and he can use the static functions as he wants.

And...where is the bug?

I'm still fine in version 1.73, at version 2,02 -> failed, i move it to directory "libraries" and set autoload, rename class Setting -> My_Setting does not error message again

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.