示例#1
0
 } else {
     $args = explode("/", Request::get()['request']);
     array_shift($args);
     if (count($args) > 1) {
         $controller = $args[0];
         array_shift($args);
         $action = $args[0];
         array_shift($args);
     } else {
         $controller = $args[0];
         array_shift($args);
         $action = "index";
     }
     // Add post arguments to args array
     if (Request::get_request_type() != "GET") {
         $args = array_merge($args, Request::post());
     }
     if (!empty(Request::files())) {
         $args = array_merge($args, array("uploads" => Request::files()));
     }
     $maj_controller = ucfirst($controller) . 'Controller';
     print $maj_controller;
     if (class_exists('Apine\\Controllers\\System\\' . $maj_controller) && method_exists('Apine\\Controllers\\System\\' . $maj_controller, $action)) {
         $return = 'Apine\\Controllers\\System\\' . $maj_controller;
         $controller = new $return();
         $view = $controller->{$action}($args);
     } else {
         throw new GenericException('Not Found', 404);
     }
 }
 // Draw the output