PHP 클래스 Webiny\Component\Rest\Response\Router

상속: use trait Webiny\Component\Http\HttpTrait, use trait Webiny\Component\StdLib\StdLibTrait
파일 보기 프로젝트 열기: Webiny/Framework 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $api, string $class, boolean $normalize, Cache $compilerCache ) Base constructor.
getMethod ( ) : string Get the http method.
getUrl ( ) : string Returns the current url path.
processRequest ( ) : CallbackResult Process the api rest request and return the CallbackResult object.
setHttpMethod ( string $method ) Force sets the http method.
setUrl ( string $url ) Set the url.

비공개 메소드들

메소드 설명
doesPatternMatch ( string $pattern, array $data, string $url ) : boolean Checks if $pattern matches $url.
getVersion ( ) : string Check if there is a specific version set in the request headers, if not, it returns 'current' version.
matchDefaultMethod ( array $callbacks, string $url, $classUrl ) : array This is the fallback method that tries to match a default method.
matchMethod ( array $callbacks, string $url ) : array Does the matching of method if method name is present in the url.
matchRequest ( array &$classData ) : CallbackResult Analyzes the request and tries to match an api method.
tryMatchingOptionalParams ( string $pattern, array $data, string $url ) : boolean This method adds the default values for missing parameters and tries to do the match again.

메소드 상세

__construct() 공개 메소드

Base constructor.
public __construct ( string $api, string $class, boolean $normalize, Cache $compilerCache )
$api string Name of the rest api configuration.
$class string Name of the rest api class.
$normalize boolean Should the url parts be normalized or not.
$compilerCache Webiny\Component\Rest\Compiler\Cache Current compiler cache instance.

getMethod() 공개 메소드

Get the http method.
public getMethod ( ) : string
리턴 string

getUrl() 공개 메소드

Returns the current url path.
public getUrl ( ) : string
리턴 string

processRequest() 공개 메소드

Process the api rest request and return the CallbackResult object.
public processRequest ( ) : CallbackResult
리턴 CallbackResult

setHttpMethod() 공개 메소드

Force sets the http method.
public setHttpMethod ( string $method )
$method string Method name.

setUrl() 공개 메소드

In case a fixed url string is passed directly into the Rest instance, using this method the url will be passed to the router.
public setUrl ( string $url )
$url string Url upon which we will try to match a service in the registered class.