Welcome Guest, Not a member yet? Register   Sign In
Can't extend the core exceptions class
#11

[eluser]toopay[/eluser]
You put my code at wrong function. Above code is for 'show_404' at Exception class, while yours is should be something like :
Code:
// ...
function show_error($heading, $message, $template = 'error_general', $status_code = 500)
    {
        set_status_header($status_code);

        $message = '<p>'.implode('</p><p>', ( ! is_array($message)) ? array($message) : $message).'</p>';

        if (ob_get_level() > $this->ob_level + 1)
        {
            ob_end_flush();
        }
        ob_start();
        include(APPPATH.'errors/'.$template.EXT);
        $buffer = ob_get_contents();
        ob_end_clean();
        return $buffer;
    }
#12

[eluser]Rushino[/eluser]
Alright. It seem you right.. i missed the code from the EXception class which is the reason it won't work and that make lots of sense. However, i still think that a library is more what i was looking for. I have to access to the CI super object.

But thanks a lots for figuring it out !




Theme © iAndrew 2016 - Forum software by © MyBB