Esempio n. 1
0
 /**
  * addHttpVerbe, permet d'ajouter les autres verbes http
  * [PUT, DELETE, UPDATE, HEAD, PATCH]
  *
  * @param string  				$method La methode HTTP
  * @param string 				$path   La route à mapper
  * @param Callable|string|array $name   Le nom de la route ou la fonction à lancer.
  * @param callable 				$cb     La fonction à lancer
  *
  * @return Application
  */
 private function addHttpVerbe($method, $path, $name, callable $cb = null)
 {
     $body = $this->request->body();
     $flag = true;
     if ($body !== null) {
         if ($body->has('_method')) {
             if ($body->get('_method') === $method) {
                 $this->routeLoader($method, $path, $name, $cb);
             }
             $flag = false;
         }
     }
     if ($flag) {
         $this->routeLoader($method, $path, $name, $cb);
     }
     return $this;
 }