public function loadErrorPage($errorType)
    {
        switch ($errorType) {
            case 'notfound':
            $code = '404';
            break;
            case 'badrequest':
            $code = '400';
            break;
            default:
            $code = $errorType;
            break;
        }
        require_once \Config::from('app')->get('errors');
        if (isset($errors)) {
            foreach ($errors as $error) {
                $aexp = explode('@', $error);
                $c = 'App\\Controllers\\'.$aexp[0];
                if (class_exists($c)) {
                    $method = 'error'.$code;
                    if (method_exists($c, $method)) {
                        $class = new $c();
                        if ($method == 'error'.$code) {
                            $class->$method();
                        }
                        exit; // quick hack for now
                    } else {
                        $class = new Errors();
                        $method = 'error'.$code;
                        $class->$method();
                    }
                } else {
                    $class = new Errors();
                    $method = 'error'.$code;
                    $class->$method();
                }
            }
        } else {
            $class = new Errors();
            $method = 'error'.$code;
            $class->$method();
        }
    }
public function loadErrorPage($errorType)
    {
        switch ($errorType) {
            case 'notfound':
            $code = '404';
            break;
            case 'badrequest':
            $code = '400';
            break;
            default:
            $code = $errorType;
            break;
        }
        require_once \Config::from('app')->get('errors');
        if (isset($errors)) {
            foreach ($errors as $error) {
                $aexp = explode('@', $error);
                $c = 'App\\Controllers\\'.$aexp[0];
                if (class_exists($c)) {
                    $method = 'error'.$code;
                    if (method_exists($c, $method)) {
                        $class = new $c();
                        if ($method == 'error'.$code) {
                            $class->$method();
                        }
                        exit; // quick hack for now
                    } else {
                        $class = new Errors();
                        $method = 'error'.$code;
                        $class->$method();
                    }
                } else {
                    $class = new Errors();
                    $method = 'error'.$code;
                    $class->$method();
                }
            }
        } else {
            $class = new Errors();
            $method = 'error'.$code;
            $class->$method();
        }
    }
public function loadErrorPage ( $ errorType ) { switch ( $ errorType ) { case 'notfound' : $ code = '404' ; break ; case 'badrequest' : $ code = '400' ; break ; default : $ code = $ errorType ; break ; } require_once \ Config :: from ( 'app' ) -> get ( 'errors' ) ; if ( isset ( $ errors ) ) { foreach ( $ errors as $ error ) { $ aexp = explode ( '@' , $ error ) ; $ c = 'App\\Controllers\\' . $ aexp [ 0 ] ; if ( class_exists ( $ c ) ) { $ method = 'error' . $ code ; if ( method_exists ( $ c , $ method ) ) { $ class = new $ c ( ) ; if ( $ method == 'error' . $ code ) { $ class -> $ method ( ) ; } exit ; // quick hack for now } else { $ class = new Errors ( ) ; $ method = 'error' . $ code ; $ class -> $ method ( ) ; } } else { $ class = new Errors ( ) ; $ method = 'error' . $ code ; $ class -> $ method ( ) ; } } } else { $ class = new Errors ( ) ; $ method = 'error' . $ code ; $ class -> $ method ( ) ; } }
Loads a requested error page.

@param string $errorType - Error type to render for

@return void
Loads a requested error page .