[eluser]Armando Ramos[/eluser]
Hi, I'm new to CI.
I recently created my own library file called "Error_handle.php" in "application/libraries" that handles any run time error.
I updated my autoload.php file to this:
$autoload['libraries'] = array('authorizor', 'error_handler');
Here is the code in which I call my the class from my library file:
Code:
function index()
{
if($this->authorizor->user_authorized())
{
$user = $_SESSION[session_id()];
//print_r($user);
try
{
$q = "";
if($user[0]['Role']['name'] == 'admin')
{
$q = Doctrine_Query::create()
->from('Rsewrite_Map rm')
->leftJoin('rm.User u');
}
else
{
$q = Doctrine_Query::create()
->from('Rewrite_Map')
->where('u_id = ?', $user[0]['id'])
->andWhere('disabled = ?', '0');
}
$rewrite_map = $q->fetchArray();
//print_r($rewrite_map);
$data['rewrite_map'] = $rewrite_map;
$this->load->view("rm_records_view", $data);
}
catch(Exception $e)
{
$this->error_handler->get_error($e, $_SERVER['HTTP_REFERER']);
}
}
}
However, I get the following error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: RM_Records::$error_handler
Filename: controllers/rm_records.php
What am I doing wrong?