PHP 클래스 Ergo\Routing\Router

상속: implements Ergo\Routing\Controller
파일 보기 프로젝트 열기: 99designs/ergo 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( $resolver = null ) Constructor
alias ( $template, $name, $to ) Register an alias from one route name to another
buildUrl ( string $name, array $parameters = [], $baseUrl = null ) Build a URL path based on a route name and associated parameters.
configure ( $file ) Configures the routemap from a php file
connect ( $template, $name, $controller = null, $metadata = [] ) Gives a route template a unique name and a controller to route to
controller ( $name ) Looks up a controller from a route name
execute ( $request ) * (non-phpdoc)
lookup ( string $path ) : RouteMatch Looks up a route match based on a url path
metadata ( $routeName ) : array Looks up metadata for a route name
redirect ( $template, $name, $to ) Create a redirect from a particular route name to another
routeByName ( $name ) : Route Looks up a route by name
setBaseUrl ( $url ) Sets a base url for url building
setDefaultMetadata ( $metadata ) Sets the default metadata to be set into routes

비공개 메소드들

메소드 설명
_getRouteMatch ( string $path, array $routes ) : mixed Look for a matching route in provided route list.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( $resolver = null )

alias() 공개 메소드

Register an alias from one route name to another
public alias ( $template, $name, $to )

buildUrl() 공개 메소드

Build a URL path based on a route name and associated parameters.
public buildUrl ( string $name, array $parameters = [], $baseUrl = null )
$name string
$parameters array

configure() 공개 메소드

Configures the routemap from a php file
public configure ( $file )

connect() 공개 메소드

Gives a route template a unique name and a controller to route to
public connect ( $template, $name, $controller = null, $metadata = [] )

controller() 공개 메소드

Looks up a controller from a route name
public controller ( $name )

execute() 공개 메소드

* (non-phpdoc)
또한 보기: Controller::execute()
public execute ( $request )

lookup() 공개 메소드

Looks up a route match based on a url path
public lookup ( string $path ) : RouteMatch
$path string
리턴 RouteMatch

metadata() 공개 메소드

Looks up metadata for a route name
public metadata ( $routeName ) : array
리턴 array

redirect() 공개 메소드

Create a redirect from a particular route name to another
public redirect ( $template, $name, $to )

routeByName() 공개 메소드

Looks up a route by name
public routeByName ( $name ) : Route
리턴 Route

setBaseUrl() 공개 메소드

Sets a base url for url building
public setBaseUrl ( $url )

setDefaultMetadata() 공개 메소드

Sets the default metadata to be set into routes
public setDefaultMetadata ( $metadata )