Example #1
0
 public static function delegate()
 {
     $route = Route::filter_by_request();
     if (!$route || empty($route)) {
         return;
     }
     if ($route->headers) {
         $route->headers->set_all();
     }
     if ($route->path->params) {
         $route->path->set_params_gets();
     }
     if ($route->path->splats) {
         $route->path->set_splat_gets();
     }
     header($_SERVER['SERVER_PROTOCOL'] . ' 200 Ok');
     if (is_bool($route->include_template) && $route->include_template) {
         self::print_wp($route);
     } else {
         self::print_body($route);
     }
     if (!is_bool($route->include_template) || !$route->include_template) {
         exit;
     }
 }