Cannot load ANY custom libraries |
[eluser]Ludatha[/eluser]
For some reason it seems that my previous issue is not just with the libraries I downloaded, but with the custom ones I create. This is my current site http://ludatha.com/php/ As you can see it has an error, every time I use a custom library it will throw this error, just with different line numbers and variables. Can someone help me? I have tried for ages trying to fix this and even my friend doesn't know. My Files welcome.php Code: <?php Ludathaauth.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); The error is: A PHP Error was encountered Severity: Notice Message: Undefined property: Welcome::$Ludathaauth Filename: controllers/welcome.php Line Number: 10 Fatal error: Call to a member function login() on a non-object in /home/ludatha/public_html/php/system/application/controllers/welcome.php on line 10
[eluser]madeks[/eluser]
I guess you knew these already but to ensure it: 1. What is your library file name? I guess it should be "Ludathaauth.php" (start with Capital letter)? 2. Did you put it in the correct path, like "app/libraries/"?
[eluser]Dam1an[/eluser]
Also when you call it in index, it should be lowercase (although I doubt that will make a difference as I think PHP is case insensitive)
[eluser]Evil Wizard[/eluser]
you're almost right Dam1an php is case insensitive when it comes to class and method/function names Code: class MY_CLASS {
[eluser]Ludatha[/eluser]
Quote:[quote author="madeks" date="1244059657"]I guess you knew these already but to ensure it: All file names are correct (I've checked thousands of times) (Yes it is Ludathaauth.php) It is in the correct path, because it does load the library, just when I try to use it I get the error.[/quote] I have fixed my problem! I need to change the name to lower-case even though it was supposed to be uppcase... Code: class Welcome extends Controller {
[eluser]Dam1an[/eluser]
Try creating a local object using the library Code: include(APPPATH.'libraries/Ludathaauth.php'); |
Welcome Guest, Not a member yet? Register Sign In |