Welcome Guest, Not a member yet? Register   Sign In
show_404 and 404_override
#6

[eluser]Unknown[/eluser]
Just had this same problem, and you can get around it by extending the Exceptions Class, something like this:

Code:
<?php
// application/core/MY_Exceptions.php
class MY_Exceptions extends CI_Exceptions {

    public function show_404($page = '', $log_error = TRUE)
    {
     include APPPATH . 'config/routes.php';

     // By default we log this, but allow a dev to skip it
  if ($log_error)
  {
   log_message('error', '404 Page Not Found --> '.$page);
  }

  if(!empty($route['404_override']) ){
   $CI =& get_instance();

   $CI->load->view('my_view');
         echo $CI->output->get_output();
         exit;
  } else {
  
   $heading = "404 Page Not Found";
   $message = "The page you requested was not found.";

  

   echo $this->show_error($heading, $message, 'error_404', 404);
   exit;
  }
    }

}

Hope it helps


Messages In This Thread
show_404 and 404_override - by El Forum - 03-28-2011, 06:57 AM
show_404 and 404_override - by El Forum - 04-05-2011, 11:53 AM
show_404 and 404_override - by El Forum - 04-05-2011, 03:00 PM
show_404 and 404_override - by El Forum - 04-05-2011, 04:15 PM
show_404 and 404_override - by El Forum - 04-05-2011, 04:58 PM
show_404 and 404_override - by El Forum - 06-07-2012, 03:35 PM
show_404 and 404_override - by El Forum - 09-22-2012, 10:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB