Symfony\Component\Routing\RouteCollection
A RouteCollection represents a set of Route instances.
When adding a route at the end of the collection, an existing route
with the same name is removed first. So there can only be one route
with a given name.
- Author: Fabien Potencier <fabien@symfony.com>
Synopsis
class RouteCollection
implements
IteratorAggregate,Countable
{
- // members
- private array $routes;
- private array $resources;
- // methods
- public void __clone()
- public ArrayIterator getIterator()
- public int count()
- public void add()
- public array all()
- public Route|null get()
- public void remove()
- public void addCollection()
- public void addPrefix()
- public void setHost()
- public void addDefaults()
- public void addRequirements()
- public void addOptions()
- public void setSchemes()
- public void setMethods()
- public array getResources()
- public void addResource()
Hierarchy
Implements
Members
private
- $resources — array
- $routes — array
Methods
public
- __clone()
- add() — Adds a route.
- addCollection() — Adds a route collection at the end of the current set by appending all routes of the added collection.
- addDefaults() — Adds defaults to all routes.
- addOptions() — Adds options to all routes.
- addPrefix() — Adds a prefix to the path of all child routes.
- addRequirements() — Adds requirements to all routes.
- addResource() — Adds a resource for this collection.
- all() — Returns all routes in this collection.
- count() — Gets the number of Routes in this collection.
- get() — Gets a route by name.
- getIterator() — Gets the current RouteCollection as an Iterator that includes all routes.
- getResources() — Returns an array of resources loaded to build this collection.
- remove() — Removes a route or an array of routes by name from the collection
- setHost() — Sets the host pattern on all routes.
- setMethods() — Sets the HTTP methods (e.g. 'POST') all child routes are restricted to.
- setSchemes() — Sets the schemes (e.g. 'https') all child routes are restricted to.