CodeIgniter Forums

Full Version: class_exists unusable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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!

El Forum

[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?

El Forum

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

El Forum

[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.

El Forum

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

El Forum

[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