[eluser]Sodavath[/eluser]
Hello there,
I have a question on how to extend 'Exceptions' to be able to refer to 'get_instance()' (using CI 2.0)
I only get errors when I try to extend it
I'm trying to access 'site_url()' so I can customize error pages with CSS but I need the relative path to it and maybe some more functions down the road
PS: So far the only working solution for me is this
I don't think it's very good/secure way to do that but it gets the job done to some extent
<b>Exceptions.php</b>
Code:
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class MY_Exceptions extends CI_Exceptions {
var $CN = '';
function __construct() {
parent::__construct();
$this->CN =& get_config();
$this->CN = $this->CN['base_url'];
}
}
<b>error_404.php</b>
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
404 Page Not Found
</title>
<link rel="shortcut icon" href="<?php echo $this->CN,APPPATH;?>media/favicon.ico" />
<link rel="stylesheet" href="<?php echo $this->CN,APPPATH;?>media/style.css" type="text/css"/>
</head>
<body>
<div id="wrap">
<div id="header">
<h1><a >CN; ?>">MY SITE</a></h1>
</div>
<div id="main">
<div id="error">
<h2><?php echo $heading; ?></h2>
<p><?php echo $message; ?></p>
</div>
</div>
</div>
<div id="footer">
BIGFOOT
</div>
</body>
</html>