conditionalParameters() 공개 메소드

Return the conditional parameters
public conditionalParameters ( ) : array
리턴 array
예제 #1
0
 /**
  * Add the given route to the arrays of routes.
  *
  * @param \Themosis\Route\Route $route
  */
 protected function addToCollections($route)
 {
     $domainAndUri = $route->domain() . $route->getUri();
     if ($route->condition() && $route->conditionalParameters()) {
         $domainAndUri .= serialize($route->conditionalParameters());
     }
     foreach ($route->methods() as $method) {
         $this->routes[$method][$domainAndUri] = $route;
     }
     $this->allRoutes[$method . $domainAndUri] = $route;
 }
예제 #2
0
 public function matches(Route $route, Request $request)
 {
     // Check if a template is associated and compare it to current route condition.
     if ($route->condition() && call_user_func_array($route->condition(), [$route->conditionalParameters()])) {
         return true;
     }
     return false;
 }