flight\net\Router::next PHP Method

next() public method

Gets the next route.
public next ( ) : Route
return Route
    public function next()
    {
        $this->index++;
    }

Usage Example

Esempio n. 1
0
 function routeRequest()
 {
     $dispatched = false;
     while ($route = $this->router->route($this->request)) {
         $params = array_values($route->params);
         $continue = $this->dispatcher->execute($route->callback, $params);
         $dispatched = true;
         if (!$continue) {
             break;
         }
         $this->router->next();
         $dispatched = false;
     }
     if (!$dispatched) {
         echo '404';
     }
 }