Welcome Guest, Not a member yet? Register   Sign In
=& get_instance in MY_Exceptions
#1

[eluser]freshface[/eluser]
How can i use $this->ci =& get_instance();


Code:
<?php
class MY_Exceptions extends CI_Exceptions
{
    var $ci;
    
    public function __construct()
    {
        parent::CI_Exceptions();
        $this->ci =& get_instance();
    }

    function show_404($page = '')
    {
    
        //lredirect('_404');
        //redirect('error_404','refresh');  // you can change this with what you want
        $content = $this->ci->db->get_where('pages',array('type' => '404', 'language_id' => LANG_ID))->row();
        if(count($content))
        {
            lredirect($content->slug);
        }
        else // failsave
        {
            $heading = "404 Page Not Found";
            $message = "The page you requested was not found.";

            log_message('error', '404 Page Not Found --> '.$page);
            echo $this->show_error($heading, $message, 'error_404');
        }

        exit;
    }
}

Without getting this error: Fatal error: Call to undefined function get_instance() in /Applications/MAMP/htdocs/albatross/app_frontend/libraries/MY_Exceptions.php on line 9


Messages In This Thread
=& get_instance in MY_Exceptions - by El Forum - 09-21-2009, 06:44 AM
=& get_instance in MY_Exceptions - by El Forum - 09-21-2009, 09:14 PM
=& get_instance in MY_Exceptions - by El Forum - 09-22-2009, 01:16 AM
=& get_instance in MY_Exceptions - by El Forum - 09-22-2009, 06:30 AM
=& get_instance in MY_Exceptions - by El Forum - 09-22-2009, 07:59 AM
=& get_instance in MY_Exceptions - by El Forum - 09-22-2009, 08:09 AM
=& get_instance in MY_Exceptions - by El Forum - 09-22-2009, 02:03 PM
=& get_instance in MY_Exceptions - by El Forum - 10-22-2009, 05:52 AM
=& get_instance in MY_Exceptions - by El Forum - 10-22-2009, 10:13 AM
=& get_instance in MY_Exceptions - by El Forum - 10-22-2009, 03:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB