Example #1
0
 private function routes($uri)
 {
     if (fnmatch('/api/*', $uri)) {
         return $this->api($uri);
     } else {
         $this->cb404 = function () {
             return ['static', 404, true];
         };
         $routes = Config::get('mvc.dir', APPLICATION_PATH) . DS . 'config' . DS . 'routes.php';
         if (File::exists($routes)) {
             require_once $routes;
             AppRoutes::defines($this);
             $back = $this->run();
             if (count($back) == 2) {
                 $back[] = true;
             }
             return $back;
         }
     }
 }
Example #2
0
 private function routes($uri)
 {
     if (fnmatch('/api/*', $uri)) {
         return self::api($uri);
     } else {
         $this->cb404 = function () {
             return ['static', 404, true];
         };
         $routes = Config::get('app.module.dir') . DS . 'config' . DS . 'routes.php';
         if (is_file($routes)) {
             require_once $routes;
             AppRoutes::defines($this);
             $back = $this->run();
             if (count($back) == 2) {
                 $back[] = true;
             }
             return $back;
         }
         return ['static', 404, true];
     }
 }