Welcome Guest, Not a member yet? Register   Sign In
Extending CI_Exceptions
#2

[eluser]xzyfer[/eluser]
I've a little more investigation and i've noticed that when calling the show_404 it in fact loads the show_404 method from the common.php, so i've simply added a show_403 function to common.php

Code:
/**
* 403 Page Handler
*
* This function is similar to the show_error() function above
* However, instead of the standard error template it displays
* 404 errors.
*
* @access    public
* @return    void
*/
function show_403($page = '')
{
    $error =& load_class('Exceptions');
    $error->show_403($page);
    exit;
}

this works a treat, but is in very bad form.

Am i to understand that the CI_Exceptions library is never explicitly loaded?

To that end, i believe the documentation on displaying errors to be slightly misleading, and IMO developers would benefit from a notice alerting to them to the fact that extended functions to to this library are not accessible via the global constructs, and require you to load/autoload it, as with any other library.

Hope someone can use this and avoid the time i wasted.


Messages In This Thread
Extending CI_Exceptions - by El Forum - 10-21-2008, 08:50 PM
Extending CI_Exceptions - by El Forum - 10-21-2008, 09:13 PM
Extending CI_Exceptions - by El Forum - 10-21-2008, 10:02 PM
Extending CI_Exceptions - by El Forum - 10-21-2008, 10:51 PM
Extending CI_Exceptions - by El Forum - 10-21-2008, 11:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB