PHP 클래스 Ergo\Routing\Route

Parses routes with parameters in them e.g
http://example.org/{myparam}
http://example.org/{myparam:integer}
http://example.org/{myparam:string}
http://example.org/{myparam}/{myparam2}?test={myparam3}
파일 보기 프로젝트 열기: 99designs/ergo

공개 메소드들

메소드 설명
__construct ( string $name, string $template )
getMatch ( $path, $metadata = null ) : RouteMatch
getName ( ) Returns the route name of the entry
getParameterNames ( ) : array Returns the names of the replaceable parameters defined in this route
interpolate ( array $parameters ) : string

보호된 메소드들

메소드 설명
_getMatches ( string $path ) : array Finds route pattern matches for the given path.

비공개 메소드들

메소드 설명
_escapeTemplate ( string $template ) : string Escape for regex except for curly braces, which are pulled out later.
_extractParameterNames ( string $template ) : array
_getParameterPattern ( string $template ) : array Gets a pattern that can be used for parsing a template
_interpolateCallback ( $matches ) A callback for preg_replace_callback() that returns interpolation parameters
_typePatternCallback ( $matches ) A callback for preg_replace_callback() that returns pattern chunks for a type

메소드 상세

__construct() 공개 메소드

public __construct ( string $name, string $template )
$name string
$template string

_getMatches() 보호된 메소드

Returns empty array if no matches found (indicating route doesn't match $path).
protected _getMatches ( string $path ) : array
$path string
리턴 array

getMatch() 공개 메소드

public getMatch ( $path, $metadata = null ) : RouteMatch
리턴 RouteMatch or null if no match.

getName() 공개 메소드

Returns the route name of the entry
public getName ( )

getParameterNames() 공개 메소드

Returns the names of the replaceable parameters defined in this route
public getParameterNames ( ) : array
리턴 array

interpolate() 공개 메소드

public interpolate ( array $parameters ) : string
$parameters array
리턴 string