src/UriTemplate/UriTemplate.php
public static function getVariables($template, array $options = array())
{
    $varnames = array();
    foreach (self::getExpressions($template, $options) as $expression) {
        if ($expression['valid']) {
            try {
                $expression = self::parseExpression($expression['expression']);
                foreach ($expression['varspecs'] as $varspec) {
                    try {
                        $varspec = self::parseVarspec($varspec);
                        $varnames[] = $varspec['varname'];
                    } catch (UriTemplateException $e) {
                        continue;
                    }
                }
            } catch (UriTemplateException $e) {
                continue;
            }
        }
    }
    return array_unique($varnames);
}
public static function getVariables($template, array $options = array())
{
    $varnames = array();
    foreach (self::getExpressions($template, $options) as $expression) {
        if ($expression['valid']) {
            try {
                $expression = self::parseExpression($expression['expression']);
                foreach ($expression['varspecs'] as $varspec) {
                    try {
                        $varspec = self::parseVarspec($varspec);
                        $varnames[] = $varspec['varname'];
                    } catch (UriTemplateException $e) {
                        continue;
                    }
                }
            } catch (UriTemplateException $e) {
                continue;
            }
        }
    }
    return array_unique($varnames);
}
public static function getVariables ( $ template , array $ options = array ( ) ) { $ varnames = array ( ) ; foreach ( self :: getExpressions ( $ template , $ options ) as $ expression ) { if ( $ expression [ 'valid' ] ) { try { $ expression = self :: parseExpression ( $ expression [ 'expression' ] ) ; foreach ( $ expression [ 'varspecs' ] as $ varspec ) { try { $ varspec = self :: parseVarspec ( $ varspec ) ; $ varnames [ ] = $ varspec [ 'varname' ] ; } catch ( UriTemplateException $ e ) { continue ; } } } catch ( UriTemplateException $ e ) { continue ; } } } return array_unique ( $ varnames ) ; }
Get a list of variables used in a URI Template.

@param  string $template  URI template
@param  array  $options   Optional settings - open, close
open - string to mark the beginning of a substitution expression
close - string to mark the end of a substitution expression
@return array             List of variables referenced by the template
Get a list of variables used in a URI Template .