RouteCollectionBuilder::build()

RouteCollection build() Creates the final RouteCollection and returns it. Return Value RouteCollection

RouteCollectionBuilder::mount()

mount(string $prefix, RouteCollectionBuilder $builder) Add a RouteCollectionBuilder. Parameters string $prefix RouteCollectionBuilder $builder

RouteCollectionBuilder::addRoute()

$this addRoute(Route $route, string|null $name = null) Adds a Route object to the builder. Parameters Route $route string|null $name Return Value $this

RouteCollectionBuilder::import()

RouteCollectionBuilder import(mixed $resource, string|null $prefix = '/', string $type = null) Import an external routing resource and returns the RouteCollectionBuilder. $routes->import('blog.yml', '/blog'); Parameters mixed $resource string|null $prefix string $type Return Value RouteCollectionBuilder Exceptions FileLoaderLoadException

RouteCollectionBuilder::createBuilder()

RouteCollectionBuilder createBuilder() Returns a RouteCollectionBuilder that can be configured and then added with mount(). Return Value RouteCollectionBuilder

RouteCollectionBuilder

class RouteCollectionBuilder Helps add and import routes into a RouteCollection. Methods __construct(LoaderInterface $loader = null) RouteCollectionBuilder import(mixed $resource, string|null $prefix = '/', string $type = null) Import an external routing resource and returns the RouteCollectionBuilder. Route add(string $path, string $controller, string|null $name = null) Adds a route and returns it for future modification. RouteCollectionBuilder createBuilder() Returns a

RouteCollectionBuilder::add()

Route add(string $path, string $controller, string|null $name = null) Adds a route and returns it for future modification. Parameters string $path The route path string $controller The route's controller string|null $name The name to give this route Return Value Route

RouteCollection::setSchemes()

setSchemes(string|array $schemes) Sets the schemes (e.g. 'https') all child routes are restricted to. Parameters string|array $schemes The scheme or an array of schemes

RouteCollection::setHost()

setHost(string $pattern, array $defaults = array(), array $requirements = array()) Sets the host pattern on all routes. Parameters string $pattern The pattern array $defaults An array of default values array $requirements An array of requirements

RouteCollection::remove()

remove(string|array $name) Removes a route or an array of routes by name from the collection. Parameters string|array $name The route name or an array of route names