public function extract($template, $uri, $strict = false)
    {
        $params = array();
        $nodes  = $this->parser->parse($template);

        foreach($nodes as $node) {

            // if strict is given, and there's no remaining uri just return null
            if ($strict && !strlen($uri)) {
                return null;
            }

            // uri'll be truncated from the start when a match is found
            $match = $node->match($this->parser, $uri, $params, $strict);

            list($uri, $params) = $match;
        }

        // if there's remaining $uri, matching is failed
        if ($strict && strlen($uri)) {
            return null;
        }

        return $params;
    }
public function extract($template, $uri, $strict = false)
    {
        $params = array();
        $nodes  = $this->parser->parse($template);

        foreach($nodes as $node) {

            // if strict is given, and there's no remaining uri just return null
            if ($strict && !strlen($uri)) {
                return null;
            }

            // uri'll be truncated from the start when a match is found
            $match = $node->match($this->parser, $uri, $params, $strict);

            list($uri, $params) = $match;
        }

        // if there's remaining $uri, matching is failed
        if ($strict && strlen($uri)) {
            return null;
        }

        return $params;
    }
public function extract ( $ template , $ uri , $ strict = false ) { $ params = array ( ) ; $ nodes = $ this -> parser -> parse ( $ template ) ; foreach ( $ nodes as $ node ) { // if strict is given, and there's no remaining uri just return null if ( $ strict && ! strlen ( $ uri ) ) { return null ; } // uri'll be truncated from the start when a match is found $ match = $ node -> match ( $ this -> parser , $ uri , $ params , $ strict ) ; list ( $ uri , $ params ) = $ match ; } // if there's remaining $uri, matching is failed if ( $ strict && strlen ( $ uri ) ) { return null ; } return $ params ; }
Extracts variables from URI

@param  string $template
@param  string $uri
@param  bool   $strict  This will perform a full match
@return null|array params or null if not match and $strict is true
Extracts variables from URI