PHP 클래스 Symfony\Component\Routing\RouteCollection

When adding a route, it overrides existing routes with the same name defined in the instance or its children and parents.
저자: Fabien Potencier ([email protected])
상속: implements IteratorAggregate, implements Countable
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$resources
$routes

공개 메소드들

메소드 설명
__clone ( )
__construct ( ) Constructor.
add ( string $name, Symfony\Component\Routing\Route $route ) Adds a route.
addCollection ( RouteCollection $collection, string $prefix = '' ) Adds a route collection to the current set of routes (at the end of the current set).
addCollection ( RouteCollection $collection, string $prefix = '', array $defaults = [], array $requirements = [], array $options = [] ) Adds a route collection to the current set of routes (at the end of the current set).
addPrefix ( string $prefix ) Adds a prefix to all routes in the current set.
addPrefix ( string $prefix, array $defaults = [], array $requirements = [], array $options = [] ) Adds a prefix to all routes in the current set.
addResource ( Symfony\Component\Config\Resource\ResourceInterface $resource ) Adds a resource for this collection.
addResource ( Symfony\Component\Routing\Resource\ResourceInterface $resource ) Adds a resource for this collection.
all ( ) : array Returns the array of routes.
count ( ) : integer Gets the number of Routes in this collection.
get ( string $name ) : Symfony\Component\Routing\Route Gets a route by name.
get ( string $name ) : Symfony\Component\Routing\Route | null Gets a route by name defined in this collection or its children.
getIterator ( ) : ArrayIterator Gets the current RouteCollection as an Iterator that includes all routes and child route collections.
getParent ( ) : RouteCollection | null Gets the parent RouteCollection.
getPrefix ( ) : string Returns the prefix that may contain placeholders.
getResources ( ) : Symfony\Component\Config\Resource\ResourceInterface[] Returns an array of resources loaded to build this collection.
getResources ( ) : Symfony\Component\Routing\Resource\ResourceInterface[] Returns an array of resources loaded to build this collection.
getRoot ( ) : RouteCollection Gets the root RouteCollection of the tree.
remove ( string | array $name ) Removes a route or an array of routes by name from all connected collections (this instance and all parents and children).

비공개 메소드들

메소드 설명
hasCollection ( RouteCollection $collection ) : boolean Checks whether the given RouteCollection is already set in any child of the current instance.
removeRecursively ( string $name ) : boolean Removes a route by name from this collection and its children recursively.
setParent ( RouteCollection $parent ) Sets the parent RouteCollection. It's only used internally from one RouteCollection to another. It makes no sense to be available as part of the public API.

메소드 상세

__clone() 공개 메소드

public __clone ( )

__construct() 공개 메소드

Constructor.
public __construct ( )

add() 공개 메소드

Adds a route.
public add ( string $name, Symfony\Component\Routing\Route $route )
$name string The route name
$route Symfony\Component\Routing\Route A Route instance

addCollection() 공개 메소드

Adds a route collection to the current set of routes (at the end of the current set).
public addCollection ( RouteCollection $collection, string $prefix = '' )
$collection RouteCollection A RouteCollection instance
$prefix string An optional prefix to add before each pattern of the route collection

addCollection() 공개 메소드

Adds a route collection to the current set of routes (at the end of the current set).
public addCollection ( RouteCollection $collection, string $prefix = '', array $defaults = [], array $requirements = [], array $options = [] )
$collection RouteCollection A RouteCollection instance
$prefix string An optional prefix to add before each pattern of the route collection
$defaults array An array of default values
$requirements array An array of requirements
$options array An array of options

addPrefix() 공개 메소드

Adds a prefix to all routes in the current set.
public addPrefix ( string $prefix )
$prefix string An optional prefix to add before each pattern of the route collection

addPrefix() 공개 메소드

Adds a prefix to all routes in the current set.
public addPrefix ( string $prefix, array $defaults = [], array $requirements = [], array $options = [] )
$prefix string An optional prefix to add before each pattern of the route collection
$defaults array An array of default values
$requirements array An array of requirements
$options array An array of options

addResource() 공개 메소드

Adds a resource for this collection.
public addResource ( Symfony\Component\Config\Resource\ResourceInterface $resource )
$resource Symfony\Component\Config\Resource\ResourceInterface A resource instance

addResource() 공개 메소드

Adds a resource for this collection.
public addResource ( Symfony\Component\Routing\Resource\ResourceInterface $resource )
$resource Symfony\Component\Routing\Resource\ResourceInterface A resource instance

all() 공개 메소드

Returns the array of routes.
public all ( ) : array
리턴 array An array of routes

count() 공개 메소드

Gets the number of Routes in this collection.
public count ( ) : integer
리턴 integer The number of routes in this collection, including nested collections

get() 공개 메소드

Gets a route by name.
public get ( string $name ) : Symfony\Component\Routing\Route
$name string The route name
리턴 Symfony\Component\Routing\Route $route A Route instance

get() 공개 메소드

Gets a route by name defined in this collection or its children.
public get ( string $name ) : Symfony\Component\Routing\Route | null
$name string The route name
리턴 Symfony\Component\Routing\Route | null A Route instance or null when not found

getIterator() 공개 메소드

Gets the current RouteCollection as an Iterator that includes all routes and child route collections.
public getIterator ( ) : ArrayIterator
리턴 ArrayIterator An \ArrayIterator interface

getParent() 공개 메소드

Gets the parent RouteCollection.
public getParent ( ) : RouteCollection | null
리턴 RouteCollection | null The parent RouteCollection or null when it's the root

getPrefix() 공개 메소드

Returns the prefix that may contain placeholders.
public getPrefix ( ) : string
리턴 string The prefix

getResources() 공개 메소드

Returns an array of resources loaded to build this collection.
public getResources ( ) : Symfony\Component\Config\Resource\ResourceInterface[]
리턴 Symfony\Component\Config\Resource\ResourceInterface[] An array of resources

getResources() 공개 메소드

Returns an array of resources loaded to build this collection.
public getResources ( ) : Symfony\Component\Routing\Resource\ResourceInterface[]
리턴 Symfony\Component\Routing\Resource\ResourceInterface[] An array of resources

getRoot() 공개 메소드

Gets the root RouteCollection of the tree.
public getRoot ( ) : RouteCollection
리턴 RouteCollection The root RouteCollection

remove() 공개 메소드

Removes a route or an array of routes by name from all connected collections (this instance and all parents and children).
public remove ( string | array $name )
$name string | array The route name or an array of route names

프로퍼티 상세

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

protected $resources

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

protected $routes