Mapper::match PHP Method

match() public static method

public static match ( $check, $url = null )
    public static function match($check, $url = null)
    {
        if (is_null($url)) {
            $url = self::here();
        }
        $check = '%^' . str_replace(array(':any', ':fragment', ':num'), array('(.+)', '([^\\/]+)', '([0-9]+)'), $check) . '/?$%';
        return preg_match($check, $url);
    }

Usage Example

Example #1
0
 public function get(array $hashMap, $isNestedKeysName = false)
 {
     $pattern = $this->getPattern($isNestedKeysName);
     $this->mapper->match($pattern, [$hashMap]);
     $data = $this->mapper->current();
     if (empty($data)) {
         $result = $this->getEmptyArray($pattern);
     } else {
         $result = $this->arrayHelper->toTuple($data, $pattern);
     }
     return $result;
 }
All Usage Examples Of Mapper::match