public function _run()
    {
        if (defined("NOT_FOUND")) {
            (new Controller())->load->error(404);
        }
        if (Configer::manualRoute()) {
            $router = Router::getInstance($this->segments);
            Configer::loadRoutes();
            try {
                if ($action = $router->run()) {
                    if (is_array($action)) {
                        $class = "App\\Controllers\\{$action['controller']}";
                        if (class_exists($class) and $class = new $class() and is_callable(array($class, $action['method']))) {
                            $class->{$action['method']}();
                        } else {
                            (new Controller())->load->error(404);
                        }
                    } else {
                        (new Controller())->load->error(404);
                    }
                } else {
                    (new Controller())->load->error(404);
                }
            } catch (MethodNotAllowedHttpException $e) {
                print "MethodNotAllowedHttpException : ".$e->getMessage();
            }
            die;
        }
        if (Configer::automaticRoute()) {
            $this->firstSegment        = empty($this->firstSegment) ? Configer::defaultRoute() : $this->firstSegment;
            $this->secondSegment    = empty($this->secondSegment) ? Configer::defaultMethod() : $this->secondSegment;
            $class = "App\\Controllers\\{$this->firstSegment}";
            if (class_exists($class) and $class = new $class() and is_callable(array($class, $this->secondSegment))) {
                $class->{$this->secondSegment}();
            } else {
                (new Controller())->load->error(404);
            }
        }
    }
public function _run()
    {
        if (defined("NOT_FOUND")) {
            (new Controller())->load->error(404);
        }
        if (Configer::manualRoute()) {
            $router = Router::getInstance($this->segments);
            Configer::loadRoutes();
            try {
                if ($action = $router->run()) {
                    if (is_array($action)) {
                        $class = "App\\Controllers\\{$action['controller']}";
                        if (class_exists($class) and $class = new $class() and is_callable(array($class, $action['method']))) {
                            $class->{$action['method']}();
                        } else {
                            (new Controller())->load->error(404);
                        }
                    } else {
                        (new Controller())->load->error(404);
                    }
                } else {
                    (new Controller())->load->error(404);
                }
            } catch (MethodNotAllowedHttpException $e) {
                print "MethodNotAllowedHttpException : ".$e->getMessage();
            }
            die;
        }
        if (Configer::automaticRoute()) {
            $this->firstSegment        = empty($this->firstSegment) ? Configer::defaultRoute() : $this->firstSegment;
            $this->secondSegment    = empty($this->secondSegment) ? Configer::defaultMethod() : $this->secondSegment;
            $class = "App\\Controllers\\{$this->firstSegment}";
            if (class_exists($class) and $class = new $class() and is_callable(array($class, $this->secondSegment))) {
                $class->{$this->secondSegment}();
            } else {
                (new Controller())->load->error(404);
            }
        }
    }
public function _run ( ) { if ( defined ( "NOT_FOUND" ) ) { ( new Controller ( ) ) -> load -> error ( 404 ) ; } if ( Configer :: manualRoute ( ) ) { $ router = Router :: getInstance ( $ this -> segments ) ; Configer :: loadRoutes ( ) ; try { if ( $ action = $ router -> run ( ) ) { if ( is_array ( $ action ) ) { $ class = "App\\Controllers\\{$action['controller']}" ; if ( class_exists ( $ class ) and $ class = new $ class ( ) and is_callable ( array ( $ class , $ action [ 'method' ] ) ) ) { $ class -> { $ action [ 'method' ] } ( ) ; } else { ( new Controller ( ) ) -> load -> error ( 404 ) ; } } else { ( new Controller ( ) ) -> load -> error ( 404 ) ; } } else { ( new Controller ( ) ) -> load -> error ( 404 ) ; } } catch ( MethodNotAllowedHttpException $ e ) { print "MethodNotAllowedHttpException : " . $ e -> getMessage ( ) ; } die ; } if ( Configer :: automaticRoute ( ) ) { $ this -> firstSegment = empty ( $ this -> firstSegment ) ? Configer :: defaultRoute ( ) : $ this -> firstSegment ; $ this -> secondSegment = empty ( $ this -> secondSegment ) ? Configer :: defaultMethod ( ) : $ this -> secondSegment ; $ class = "App\\Controllers\\{$this->firstSegment}" ; if ( class_exists ( $ class ) and $ class = new $ class ( ) and is_callable ( array ( $ class , $ this -> secondSegment ) ) ) { $ class -> { $ this -> secondSegment } ( ) ; } else { ( new Controller ( ) ) -> load -> error ( 404 ) ; } } }
Here we go...
Here we go ...