Beispiel #1
0
 public function set_all()
 {
     foreach ($this->names as $header => $value) {
         if (strtolower($header) == 'exclude') {
             \_u::each($value, function ($v, $i) {
                 header_remove($v);
             });
         } else {
             header($header . ': ' . $value);
         }
     }
 }
Beispiel #2
0
 public function add_routes()
 {
     $routes = func_get_args();
     \_u::each($routes, function ($route, $index) {
         $method = key($route);
         $items = $route[$method];
         if (!Method::has_method(strtolower($method))) {
             continue;
         }
         $route = new Route($items);
         $route->method = new Method($method);
         if (isset($items['headers']) && is_array($items['headers'])) {
             $route->headers = Headers::set_for_route($items['headers']);
         }
         $this->routes[] = $route;
     });
 }
Beispiel #3
0
 /**
  * Set $_GET params.
  */
 public function set_params_gets()
 {
     \_u::each($this->params, function ($param, $index) {
         $_GET[$index] = $param;
     });
 }