Example #1
0
 /**
  * check path against placeholders of route
  * and return associative array with placeholders which would have a value assigned
  * 
  * @param Route $route
  * @param string $path
  * @return array
  */
 private static function getSatisfiedPlaceholders($route, $path)
 {
     $placeholderNames = $route->getPlaceholderNames();
     if (!empty($placeholderNames)) {
         if (preg_match('~(?:/|^)' . $route->getMatchExpression() . '(?:/|$)~', $path, $matches)) {
             array_shift($matches);
             return array_combine(array_slice($placeholderNames, 0, count($matches)), $matches);
         }
     }
     return [];
 }