Welcome Guest, Not a member yet? Register   Sign In
Creating Own Library error
#1

[eluser]Murali krishna[/eluser]
Hi,

I was trying to create a new library and placed it inside application/libraries.
I have loaded the library in the autoload.php by adding the same in $autoload['libraries'].

when i try to call the function in the controller page it give me a error

Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: Recruitment::$Empinfo
Filename: controllers/recruitment.php
Line Number: 96

Fatal error: Call to a member function setEmpEmail() on a non-object in /var/www/html/system/application/controllers/recruitment.php on line 96

I am posting my code here for you reference

Library Empinfo.php (placed in application/libraries)
Code:
class Empinfo {
    
    var $empid;
    var $empemail;
    
    function Empinfo(){
        $this->empid = "";
        $this->empemail = "";
    }
    
    function setEmpEmail($email){
        $this->empemail = $email;
    }
}

Calling it in controller page
Code:
$this->Empinfo->setEmpEmail("murali");

kindly let me know what could be the error.

Thanks and regards
Murali krishna .L


Messages In This Thread
Creating Own Library error - by El Forum - 03-19-2010, 12:53 AM
Creating Own Library error - by El Forum - 03-19-2010, 01:49 AM
Creating Own Library error - by El Forum - 03-19-2010, 02:27 AM
Creating Own Library error - by El Forum - 03-19-2010, 04:08 AM
Creating Own Library error - by El Forum - 03-19-2010, 04:10 AM
Creating Own Library error - by El Forum - 03-19-2010, 04:21 AM
Creating Own Library error - by El Forum - 03-19-2010, 04:28 AM
Creating Own Library error - by El Forum - 03-19-2010, 07:20 AM
Creating Own Library error - by El Forum - 03-21-2010, 11:50 PM
Creating Own Library error - by El Forum - 03-22-2010, 04:54 PM
Creating Own Library error - by El Forum - 03-22-2010, 11:29 PM
Creating Own Library error - by El Forum - 03-23-2010, 07:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB