PHP 클래스 Webiny\Component\Router\Route\RouteCollection

Note that if you store two routes with the same name, the first route will be overwritten.
상속: use trait Webiny\Component\StdLib\StdLibTrait
파일 보기 프로젝트 열기: Webiny/Framework 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( ) Base constructor.
add ( string $name, Route $route ) Adds a Route to the end of current collection.
addOption ( string $name, array $attributes ) Adds an option for all the routes within the collection.
all ( ) : array Returns an array of all routes within the collection.
count ( ) : integer Returns the number of routes within the current collection.
get ( string $name ) : Route Returns the route under the given name.
prepend ( string $name, Route $route ) Adds a Route to the beginning of current collection.
remove ( string $name ) Removes the route under the given name.
setHost ( string $host ) Sets the host filter to all routes within the collection.
setMethods ( array | string $methods ) Sets the method filter to all routes within the collection.
setSchemes ( array | string $schemes ) Sets the scheme filter to all routes within the collection.

메소드 상세

__construct() 공개 메소드

Base constructor.
public __construct ( )

add() 공개 메소드

Adds a Route to the end of current collection.
public add ( string $name, Route $route )
$name string Route name.
$route Route Instance of Route.

addOption() 공개 메소드

Adds an option for all the routes within the collection.
public addOption ( string $name, array $attributes )
$name string Name of the route parameter.
$attributes array Parameter attributes.

all() 공개 메소드

Returns an array of all routes within the collection.
public all ( ) : array
리턴 array

count() 공개 메소드

Returns the number of routes within the current collection.
public count ( ) : integer
리턴 integer

get() 공개 메소드

Returns the route under the given name.
public get ( string $name ) : Route
$name string Name of the route.
리턴 Route

prepend() 공개 메소드

Adds a Route to the beginning of current collection.
public prepend ( string $name, Route $route )
$name string Route name.
$route Route Instance of Route.

remove() 공개 메소드

Removes the route under the given name.
public remove ( string $name )
$name string Route name.

setHost() 공개 메소드

Sets the host filter to all routes within the collection.
public setHost ( string $host )
$host string Host name. Example: www.webiny.com

setMethods() 공개 메소드

Sets the method filter to all routes within the collection.
public setMethods ( array | string $methods )
$methods array | string Url method. Example: POST | GET

setSchemes() 공개 메소드

Sets the scheme filter to all routes within the collection.
public setSchemes ( array | string $schemes )
$schemes array | string Url scheme. Example: https