[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