PHP 인터페이스 Autarky\Routing\RouterInterface

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

공개 메소드들

메소드 설명
addRoute ( string | array $method, string $path, string $handler, string $name = null ) Add a route to the router.
dispatch ( Request $request ) : Response Dispatch a request in the router.
getCurrentRoute ( ) : Route Get the route matched to the current request.
getRoute ( string $name ) : Route Given a route name, get the route object.
group ( array $flags, Closure $callback ) : void Define a route group.
mount ( array $routes, string $path = '/' ) : void Mount an array config onto the routes.

메소드 상세

addRoute() 공개 메소드

Add a route to the router.
public addRoute ( string | array $method, string $path, string $handler, string $name = null )
$method string | array HTTP methods the route should respond to
$path string Relative URL the route should respond to. Parameters wrapped in }
$handler string string of "class:method" or "global_function"
$name string Route name (optional)

dispatch() 공개 메소드

Dispatch a request in the router.
public dispatch ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
리턴 Symfony\Component\HttpFoundation\Response

getCurrentRoute() 공개 메소드

Get the route matched to the current request.
public getCurrentRoute ( ) : Route
리턴 Route

getRoute() 공개 메소드

Given a route name, get the route object.
public getRoute ( string $name ) : Route
$name string
리턴 Route

group() 공개 메소드

Define a route group.
public group ( array $flags, Closure $callback ) : void
$flags array Valid keys are 'before', 'after', 'prefix'
$callback Closure First argument is the router ($this)
리턴 void

mount() 공개 메소드

Mount an array config onto the routes.
public mount ( array $routes, string $path = '/' ) : void
$routes array
$path string
리턴 void