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

#1
[eluser]Unknown[/eluser]
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!

#2
[eluser]Nick_MyShuitings[/eluser]
Unless you require that class, your code does not know it exists. You could perhaps put it in the autoload array?

#3
[eluser]danmontgomery[/eluser]
Nothing in the application/config directory is expected to be a class.

#4
[eluser]Nick_MyShuitings[/eluser]
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.

#5
[eluser]toopay[/eluser]
And...where is the bug?

#6
[eluser]Unknown[/eluser]
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.