Copied!

| 1 | {?list} ?list=red,green,blue | {name}=(?:\w+(?:,\w+?))
| 2 | {?list} ?list=red&list=green&list=blue | {name}+=(?:{$value}+(?:{sep}{name}+={$value}))
| 3 | {?keys} ?keys=semi,%3B,dot,.,comma,%2C | (same as 1)
| 4 | {?keys
} ?semi=%3B&dot=.&comma=%2C | (same as 2)
| 5 | {?list} ?list[]=red&list[]=green&list[]=blue | {name[]}+=(?:{$value}+(?:{sep}{name[]}+={$value}))*

Cloneable Instantiable
Properties
public Rize\UriTemplate\Operator\Abstraction :: $empty
public Rize\UriTemplate\Operator\Abstraction :: $first
public Rize\UriTemplate\Operator\Abstraction :: $id
 

start - Variable offset position, level-2 operators start at 1

    (exclude operator itself, e.g. {?query})

first - If variables found, prepend this value to it
named - Whether or not the expansion includes the variable or key name
reserved - union of (unreserved / reserved / pct-encoded)

public Rize\UriTemplate\Operator\Abstraction :: $named
public Rize\UriTemplate\Operator\Abstraction :: $reserved
public static Rize\UriTemplate\Operator\Abstraction :: $reserved_chars = [ '%3A' => ':' , '%2F' => '/' , '%3F' => '?' , '%23' => '#' , '%5B' => '[' , '%5D' => ']' , '%40' => '@' , '%21' => '!' , '%24' => '$' , '%26' => '&' , '%27' => ''' , '%28' => '(' , '%29' => ')' , '%2A' => '*' , '%2B' => '+' , '%2C' => ',' , '%3B' => ';' , '%3D' => '=' ]
 

gen-delims | sub-delims

public Rize\UriTemplate\Operator\Abstraction :: $sep
public Rize\UriTemplate\Operator\Abstraction :: $start
Methods
public Rize\UriTemplate\Operator\Abstraction :: __construct ( $id , $named , $sep , $empty , $reserved , $start , $first )
public static Rize\UriTemplate\Operator\Abstraction :: createById ( $id )
public Rize\UriTemplate\Operator\Abstraction :: decode ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , $values )
 

Decodes variable

  • return string decoded string
public Rize\UriTemplate\Operator\Abstraction :: encode ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , $values )
 

Encodes variable according to spec (reserved or unreserved)

  • return string encoded string
public encodeExplodeVars ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , $data )
public Rize\UriTemplate\Operator\Abstraction :: expand ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , array $params = [ ] )
public expandExplode ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , array $val )
public expandNonExplode ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , array $val )
public expandString ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , $val )
public extract ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , $data )
public static Rize\UriTemplate\Operator\Abstraction :: isValid ( $id )
public toRegex ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var )
Properties
protected static Rize\UriTemplate\Operator\Abstraction :: $loaded
protected static Rize\UriTemplate\Operator\Abstraction :: $pathRegex = '(?:[a-zA-Z0-9\-\._~!\$&'\(\)\*\+,;=%:@]+|%(?![A-Fa-f0-9]{2}))'
 

RFC 3986 Allowed path characters regex except the path delimiter '/'.

  • var string
protected static Rize\UriTemplate\Operator\Abstraction :: $queryRegex = '(?:[a-zA-Z0-9\-\._~!\$'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))'
 

RFC 3986 Allowed query characters regex except the query parameter delimiter '&'.

  • var string
protected static Rize\UriTemplate\Operator\Abstraction :: $types = [ '' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 0 , 'first' => NULL ] , '+' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => true , 'start' => 1 , 'first' => NULL ] , '.' => [ 'sep' => '.' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => '.' ] , '/' => [ 'sep' => '/' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => '/' ] , ';' => [ 'sep' => ';' , 'named' => true , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => ';' ] , '?' => [ 'sep' => '&' , 'named' => true , 'empty' => '=' , 'reserved' => false , 'start' => 1 , 'first' => '?' ] , '&' => [ 'sep' => '&' , 'named' => true , 'empty' => '=' , 'reserved' => false , 'start' => 1 , 'first' => '&' ] , '#' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => true , 'start' => 1 , 'first' => '#' ] ]
Methods
protected Rize\UriTemplate\Operator\Abstraction :: getRegex ()
 

Returns the correct regex given the variable location in the URI

  • return string
Properties
protected static Rize\UriTemplate\Operator\Abstraction :: $loaded
protected static Rize\UriTemplate\Operator\Abstraction :: $pathRegex = '(?:[a-zA-Z0-9\-\._~!\$&'\(\)\*\+,;=%:@]+|%(?![A-Fa-f0-9]{2}))'
 

RFC 3986 Allowed path characters regex except the path delimiter '/'.

  • var string
protected static Rize\UriTemplate\Operator\Abstraction :: $queryRegex = '(?:[a-zA-Z0-9\-\._~!\$'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))'
 

RFC 3986 Allowed query characters regex except the query parameter delimiter '&'.

  • var string
public static Rize\UriTemplate\Operator\Abstraction :: $reserved_chars = [ '%3A' => ':' , '%2F' => '/' , '%3F' => '?' , '%23' => '#' , '%5B' => '[' , '%5D' => ']' , '%40' => '@' , '%21' => '!' , '%24' => '$' , '%26' => '&' , '%27' => ''' , '%28' => '(' , '%29' => ')' , '%2A' => '*' , '%2B' => '+' , '%2C' => ',' , '%3B' => ';' , '%3D' => '=' ]
 

gen-delims | sub-delims

protected static Rize\UriTemplate\Operator\Abstraction :: $types = [ '' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 0 , 'first' => NULL ] , '+' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => true , 'start' => 1 , 'first' => NULL ] , '.' => [ 'sep' => '.' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => '.' ] , '/' => [ 'sep' => '/' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => '/' ] , ';' => [ 'sep' => ';' , 'named' => true , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => ';' ] , '?' => [ 'sep' => '&' , 'named' => true , 'empty' => '=' , 'reserved' => false , 'start' => 1 , 'first' => '?' ] , '&' => [ 'sep' => '&' , 'named' => true , 'empty' => '=' , 'reserved' => false , 'start' => 1 , 'first' => '&' ] , '#' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => true , 'start' => 1 , 'first' => '#' ] ]
Methods
public static Rize\UriTemplate\Operator\Abstraction :: createById ( $id )
public static Rize\UriTemplate\Operator\Abstraction :: isValid ( $id )
© 2020 Bruce Wells
Search Namespaces \ Classes
Configuration Numbers (0-9.) only