PHP 클래스 Autarky\Routing\Route

파일 보기 프로젝트 열기: autarky/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$controller callable
$methods array
$name null | string
$options array
$params array | null
$pattern string
$router Router

공개 메소드들

메소드 설명
__construct ( array $methods, string $pattern, callable $controller, string $name = null, array $options = [] )
__set_state ( array $data ) : static Re-build a Route object from data that has been var_export-ed.
addAfterHook ( string $hook ) Add an after hook.
addBeforeHook ( string $hook ) Add a before hook.
addHook ( string $when, string $hook ) Add a before or after hook.
getAfterHooks ( ) : string[] Get the route's after hooks.
getBeforeHooks ( ) : string[] Get the route's before hooks.
getController ( ) : callable Get the callable controller for the route.
getMethods ( ) : string[] Get the methods the route responds to.
getName ( ) : string | null Get the route's name.
getOption ( $option ) : mixed Get a route option.
getOptions ( ) : array Get the route options.
getParams ( ) : array Get the parameters. Can only be called on a route that has been matched against an URI (i.e. setParams has been called)
getPattern ( ) : string Get the URI pattern the route should match against.
setParams ( array $params ) When a match against the route has been confirmed, extract the parameters from the URI and pass them as an associative array to this method.
setRouter ( Autarky\Routing\RouterInterface $router ) Set the router the route objects use.

메소드 상세

__construct() 공개 메소드

public __construct ( array $methods, string $pattern, callable $controller, string $name = null, array $options = [] )
$methods array HTTP methods allowed for this route
$pattern string
$controller callable
$name string
$options array

__set_state() 공개 정적인 메소드

Re-build a Route object from data that has been var_export-ed.
public static __set_state ( array $data ) : static
$data array
리턴 static

addAfterHook() 공개 메소드

Add an after hook.
public addAfterHook ( string $hook )
$hook string

addBeforeHook() 공개 메소드

Add a before hook.
public addBeforeHook ( string $hook )
$hook string

addHook() 공개 메소드

Add a before or after hook.
public addHook ( string $when, string $hook )
$when string "before" or "after"
$hook string

getAfterHooks() 공개 메소드

Get the route's after hooks.
public getAfterHooks ( ) : string[]
리턴 string[]

getBeforeHooks() 공개 메소드

Get the route's before hooks.
public getBeforeHooks ( ) : string[]
리턴 string[]

getController() 공개 메소드

Get the callable controller for the route.
public getController ( ) : callable
리턴 callable

getMethods() 공개 메소드

Get the methods the route responds to.
public getMethods ( ) : string[]
리턴 string[]

getName() 공개 메소드

Get the route's name.
public getName ( ) : string | null
리턴 string | null

getOption() 공개 메소드

Get a route option.
public getOption ( $option ) : mixed
$option string
리턴 mixed Returns null if option not set.

getOptions() 공개 메소드

Get the route options.
public getOptions ( ) : array
리턴 array

getParams() 공개 메소드

Get the parameters. Can only be called on a route that has been matched against an URI (i.e. setParams has been called)
public getParams ( ) : array
리턴 array

getPattern() 공개 메소드

Get the URI pattern the route should match against.
public getPattern ( ) : string
리턴 string

setParams() 공개 메소드

When a match against the route has been confirmed, extract the parameters from the URI and pass them as an associative array to this method.
public setParams ( array $params )
$params array

setRouter() 공개 정적인 메소드

Somewhat of a hack to make var_export caching work.
public static setRouter ( Autarky\Routing\RouterInterface $router )
$router Autarky\Routing\RouterInterface

프로퍼티 상세

$controller 보호되어 있는 프로퍼티

protected callable $controller
리턴 callable

$methods 보호되어 있는 프로퍼티

protected array $methods
리턴 array

$name 보호되어 있는 프로퍼티

protected null|string $name
리턴 null | string

$options 보호되어 있는 프로퍼티

protected array $options
리턴 array

$params 보호되어 있는 프로퍼티

protected array|null $params
리턴 array | null

$pattern 보호되어 있는 프로퍼티

protected string $pattern
리턴 string

$router 보호되어 있는 정적으로 프로퍼티

protected static Router,Autarky\Routing $router
리턴 Router